lkml.org 
[lkml]   [2018]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH] drivers/net: appletalk/cops: remove redundant if statement and mask
From
From: Colin King <colin.king@canonical.com>
Date: Sat, 22 Dec 2018 16:58:41 +0000

> @@ -777,10 +777,7 @@ static void cops_rx(struct net_device *dev)
> }
>
> /* Get response length. */
> - if(lp->board==DAYNA)
> - pkt_len = inb(ioaddr) & 0xFF;
> - else
> - pkt_len = inb(ioaddr) & 0x00FF;
> + pkt_len = inb(ioaddr);

There are other instances of similar weird identical statements guarded
by the test on the board type being DAYNA.

For example, in cops_send_packet():

if(lp->board == DAYNA)
outb(skb->len >> 8, ioaddr);
else
outb((skb->len >> 8)&0x0FF, ioaddr);

Could you scan the rest of the driver and deal with all of these
instances in one go?

Thank you!

\
 
 \ /
  Last update: 2018-12-24 19:08    [W:0.543 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site