Re: [PATCH][V2] drivers/net: appletalk/cops: remove redundant if statement and mask

From: Sergei Shtylyov
Date: Tue Dec 25 2018 - 03:06:26 EST

On 24.12.2018 22:41, Colin King wrote:

From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

The two different assignments for pkt_len are actually the same and
so the if statement is redundant and can be removed. Masking a u8
return value from inb() with 0xFF is also redundant and can also be

Removed. :-)

Similarly, the two different outb calls are identical as the mask
of 0xff on the second outb is redundant since a u8 is being written,
so the if statement is also redundant and can be also removed.

Detected by CoverityScan, CID#1475639 ("Identical code for different


V2: Remove the if statement for the outb calls, thanks to David
Miller for spotting this.

Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>

MBR, Sergei