On 20/11/2014 07:44, Gonglei wrote:
> Maybe not, since two branch are "if and else if" not "if and else",
> so this change make the below code segment's wide ...
>> >     bcnt = 4096 - GET_FIELD(tmd.length, TMDL, BCNT);
>> >     s->phys_mem_read(s->dma_opaque, PHYSADDR(s, tmd.tbadr),
>> >                      s->buffer + s->xmit_pos, bcnt, CSR_BSWP(s));
>> >     s->xmit_pos += bcnt;
> ... more extensive.

After your patch that fixes the coverity report, they are

   if (a && b)
   else if (b)

so you can change it to

   if (!b) goto txdone;
   if (a) ...
   else ...

and then

   if (!b) goto txdone;
   <common part>
   if (!a) {
       <extra part from else>
   }

Paolo

Reply via email to