From: Dan Carpenter <dan.carpenter@oracle.com>
To: Lukasz Stelmach <l.stelmach@samsung.com>
Cc: kernel-janitors@vger.kernel.org
Subject: Re: [bug report] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver
Date: Tue, 16 Nov 2021 09:34:35 +0300 [thread overview]
Message-ID: <20211116063435.GG26989@kadam> (raw)
In-Reply-To: <dleftj35nxhqvn.fsf%l.stelmach@samsung.com>
On Tue, Nov 16, 2021 at 01:43:24AM +0100, Lukasz Stelmach wrote:
> It was <2021-11-12 pią 15:36>, when Dan Carpenter wrote:
> > Hello Łukasz Stelmach,
> >
> > The patch a97c69ba4f30: "net: ax88796c: ASIX AX88796C SPI Ethernet
> > Adapter Driver" from Oct 20, 2021, leads to the following Smatch
> > static checker warning:
> >
> > drivers/net/ethernet/asix/ax88796c_main.c:391 ax88796c_start_xmit()
> > warn: test_bit() takes a bit number
> >
> > drivers/net/ethernet/asix/ax88796c_main.c
> > 382 static int
> > 383 ax88796c_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> > 384 {
> > 385 struct ax88796c_device *ax_local = to_ax88796c_device(ndev);
> > 386
> > 387 skb_queue_tail(&ax_local->tx_wait_q, skb);
> > 388 if (skb_queue_len(&ax_local->tx_wait_q) > TX_QUEUE_HIGH_WATER)
> > 389 netif_stop_queue(ndev);
> > 390
> > --> 391 set_bit(EVENT_TX, &ax_local->flags);
> >
> > EVENT_TX is BIT(1) so this ends up being a double BIT(BIT(1));. Which
> > is fine because it seems to be done consistently. But probably it
> > should be:
> >
> > #define EVENT_INTR 0
> > #define EVENT_TX 1
> > #define EVENT_SET_MULTI 2
> >
>
> Apparently this is a porting artifact. Originally these were defined as
> {1,2,4}[1] so I changed that to BIT(x) without much
> consideration. I am fixing it. Thanks for reporting.
Changing it back to 1,2,4 will hide bug from the Smatch but the correct
values are 0,1,2.
regards,
dan carpenter
next prev parent reply other threads:[~2021-11-16 6:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20211116004339eucas1p14e377393256e09c0e04e3da92ad0accb@eucas1p1.samsung.com>
2021-11-12 12:36 ` [bug report] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver Dan Carpenter
2021-11-16 0:43 ` Lukasz Stelmach
2021-11-16 6:34 ` Dan Carpenter [this message]
[not found] <CGME20211115132037eucas1p1ff59893ece466fbc5123513d355cb361@eucas1p1.samsung.com>
2021-11-11 13:35 ` Dan Carpenter
2021-11-15 13:20 ` Lukasz Stelmach
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=20211116063435.GG26989@kadam \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=l.stelmach@samsung.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox