From: Colin Ian King <colin.king@canonical.com> To: David Miller <davem@davemloft.net> Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/net: appletalk/cops: remove redundant if statement and mask Date: Mon, 24 Dec 2018 18:11:27 +0000 [thread overview] Message-ID: <8c43fd16-8c73-00b8-7c72-1f3e15a2fdc2@canonical.com> (raw) In-Reply-To: <20181224.100836.117884501889550887.davem@davemloft.net> On 24/12/2018 18:08, David Miller wrote: > 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? Will do, probably in a day or so. > > Thank you! >
WARNING: multiple messages have this Message-ID (diff)
From: Colin Ian King <colin.king@canonical.com> To: David Miller <davem@davemloft.net> Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/net: appletalk/cops: remove redundant if statement and mask Date: Mon, 24 Dec 2018 18:11:27 +0000 [thread overview] Message-ID: <8c43fd16-8c73-00b8-7c72-1f3e15a2fdc2@canonical.com> (raw) In-Reply-To: <20181224.100836.117884501889550887.davem@davemloft.net> On 24/12/2018 18:08, David Miller wrote: > 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? Will do, probably in a day or so. > > Thank you! >
next prev parent reply other threads:[~2018-12-24 18:11 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-12-22 16:58 [PATCH] drivers/net: appletalk/cops: remove redundant if statement and mask Colin King 2018-12-22 16:58 ` Colin King 2018-12-24 18:08 ` David Miller 2018-12-24 18:08 ` David Miller 2018-12-24 18:11 ` Colin Ian King [this message] 2018-12-24 18:11 ` Colin Ian King
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=8c43fd16-8c73-00b8-7c72-1f3e15a2fdc2@canonical.com \ --to=colin.king@canonical.com \ --cc=davem@davemloft.net \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=netdev@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.