Re: [bug report] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux