lib9p2000: cleanup redundant checks in convM2S
CID 49221 (#1 of 1): Identical code for different branches (IDENTICAL_BRANCHES) identical_branches: The same code is executed when the condition p == NULL is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
This commit is contained in:
parent
663b002529
commit
90f3d2ce31
@ -109,10 +109,7 @@ convM2S(uint8_t *ap, uint32_t nap, Fcall *f)
|
||||
if(p == nil)
|
||||
break;
|
||||
p = gstring(p, ep, &f->aname);
|
||||
if(p == nil)
|
||||
break;
|
||||
break;
|
||||
|
||||
case Tattach:
|
||||
if(p+BIT32SZ > ep)
|
||||
return 0;
|
||||
@ -126,10 +123,7 @@ convM2S(uint8_t *ap, uint32_t nap, Fcall *f)
|
||||
if(p == nil)
|
||||
break;
|
||||
p = gstring(p, ep, &f->aname);
|
||||
if(p == nil)
|
||||
break;
|
||||
break;
|
||||
|
||||
case Twalk:
|
||||
if(p+BIT32SZ+BIT32SZ+BIT16SZ > ep)
|
||||
return 0;
|
||||
@ -246,16 +240,10 @@ convM2S(uint8_t *ap, uint32_t nap, Fcall *f)
|
||||
|
||||
case Rauth:
|
||||
p = gqid(p, ep, &f->aqid);
|
||||
if(p == nil)
|
||||
break;
|
||||
break;
|
||||
|
||||
case Rattach:
|
||||
p = gqid(p, ep, &f->qid);
|
||||
if(p == nil)
|
||||
break;
|
||||
break;
|
||||
|
||||
case Rwalk:
|
||||
if(p+BIT16SZ > ep)
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user