Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ed5282c authored by NeilBrown's avatar NeilBrown Committed by J. Bruce Fields
Browse files

svcauth_gss: replace a trivial 'switch' with an 'if'



Code like:

  switch(xxx) {
  case -error1:
  case -error2:
     ..
     return;
  case 0:
     stuff;
  }

  can more naturally be written:

  if (xxx < 0)
      return;

  stuff;

Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 839049a8
Loading
Loading
Loading
Loading
+19 −22
Original line number Diff line number Diff line
@@ -1034,13 +1034,10 @@ static int svcauth_gss_handle_init(struct svc_rqst *rqstp,
	rsi_free(&rsikey);
	if (!rsip)
		return SVC_CLOSE;
	switch (cache_check(&rsi_cache, &rsip->h, &rqstp->rq_chandle)) {
	case -EAGAIN:
	case -ETIMEDOUT:
	case -ENOENT:
	if (cache_check(&rsi_cache, &rsip->h, &rqstp->rq_chandle) < 0)
		/* No upcall result: */
		return SVC_CLOSE;
	case 0:

	ret = SVC_CLOSE;
	/* Got an answer to the upcall; use it: */
	if (gss_write_init_verf(rqstp, rsip))
@@ -1057,7 +1054,7 @@ static int svcauth_gss_handle_init(struct svc_rqst *rqstp,
	svc_putnl(resv, GSS_SEQ_WIN);
	if (svc_safe_putnetobj(resv, &rsip->out_token))
		goto out;
	}

	ret = SVC_COMPLETE;
out:
	cache_put(&rsip->h, &rsi_cache);