From: Lukasz Stelmach <l.stelmach@samsung.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kernel-janitors@vger.kernel.org
Subject: Re: [bug report] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver
Date: Mon, 15 Nov 2021 14:20:28 +0100 [thread overview]
Message-ID: <dleftj7dd9imhv.fsf%l.stelmach@samsung.com> (raw)
In-Reply-To: <20211111133508.GA22045@kili> (Dan Carpenter's message of "Thu, 11 Nov 2021 16:35:08 +0300")
[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]
It was <2021-11-11 czw 16:35>, 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:926 ax88796c_set_features()
> warn: duplicate check 'changed & ((1 << (40)) | (1 << (3)))' (previous on line 921)
>
> drivers/net/ethernet/asix/ax88796c_main.c
> 915 static int
> 916 ax88796c_set_features(struct net_device *ndev, netdev_features_t features)
> 917 {
> 918 struct ax88796c_device *ax_local = to_ax88796c_device(ndev);
> 919 netdev_features_t changed = features ^ ndev->features;
> 920
> 921 if (!(changed & (NETIF_F_RXCSUM | NETIF_F_HW_CSUM)))
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> 922 return 0;
> 923
> 924 ndev->features = features;
> 925
> --> 926 if (changed & (NETIF_F_RXCSUM | NETIF_F_HW_CSUM))
>
> We know this condition is true. Was something else intended?
>
To have a readable template to add more ifs below with other features.
In such case the if at line 921 would check for all supported
features and this and following ifs would act upon different flags.
> 927 ax88796c_set_csums(ax_local);
> 928
> 929 return 0;
> 930 }
>
> regards,
> dan carpenter
>
>
--
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2021-11-15 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20211115132037eucas1p1ff59893ece466fbc5123513d355cb361@eucas1p1.samsung.com>
2021-11-11 13:35 ` [bug report] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver Dan Carpenter
2021-11-15 13:20 ` Lukasz Stelmach [this message]
[not found] <CGME20211116004339eucas1p14e377393256e09c0e04e3da92ad0accb@eucas1p1.samsung.com>
2021-11-12 12:36 ` Dan Carpenter
2021-11-16 0:43 ` Lukasz Stelmach
2021-11-16 6:34 ` Dan Carpenter
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=dleftj7dd9imhv.fsf%l.stelmach@samsung.com \
--to=l.stelmach@samsung.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@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: 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