Skip to content

Commit bd437c9

Browse files
Colin Ian Kingdavem330
authored andcommitted
drivers/net: appletalk/cops: remove redundant if statement and mask
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 emoved. 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 branches") V2: Remove the if statement for the outb calls, thanks to David Miller for spotting this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 61988bd commit bd437c9

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

‎drivers/net/appletalk/cops.c‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,7 @@ static void cops_rx(struct net_device *dev)
777777
}
778778

779779
/* Get response length. */
780-
if(lp->board==DAYNA)
781-
pkt_len = inb(ioaddr) & 0xFF;
782-
else
783-
pkt_len = inb(ioaddr) & 0x00FF;
780+
pkt_len = inb(ioaddr);
784781
pkt_len |= (inb(ioaddr) << 8);
785782
/* Input IO code. */
786783
rsp_type=inb(ioaddr);
@@ -892,10 +889,7 @@ static netdev_tx_t cops_send_packet(struct sk_buff *skb,
892889

893890
/* Output IO length. */
894891
outb(skb->len, ioaddr);
895-
if(lp->board == DAYNA)
896-
outb(skb->len >> 8, ioaddr);
897-
else
898-
outb((skb->len >> 8)&0x0FF, ioaddr);
892+
outb(skb->len >> 8, ioaddr);
899893

900894
/* Output IO code. */
901895
outb(LAP_WRITE, ioaddr);

0 commit comments

Comments
 (0)