[Intel-wired-lan] [PATCH net-next v2 02/11] intel: remove checker warning

Switzer, David david.switzer at intel.com
Thu Apr 22 22:53:34 UTC 2021


>-----Original Message-----
>From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of Jesse
>Brandeburg
>Sent: Thursday, March 25, 2021 5:38 PM
>To: intel-wired-lan at lists.osuosl.org
>Subject: [Intel-wired-lan] [PATCH net-next v2 02/11] intel: remove checker
>warning
>
>The sparse checker (C=2) found an assignment where we were mixing types when
>trying to convert from data read directly from the device NVM, to an array in CPU
>order in-memory, which unfortunately the driver tries to do in-place.
>
>This is easily solved by using the swap operation instead of an assignment, and is
>already proven in other Intel drivers to be functionally correct and the same code,
>just without a sparse warning.
>
>The change is the same in all three drivers.
>
>Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
>---
>Warning Detail:
>  CHECK   .../e1000/e1000_ethtool.c
>.../e1000/e1000_ethtool.c:516:32: warning: incorrect type in assignment
>(different base types)
>.../e1000/e1000_ethtool.c:516:32:    expected unsigned short [usertype]
>.../e1000/e1000_ethtool.c:516:32:    got restricted __le16 [usertype]
>  CHECK   .../igb/igb_ethtool.c
>.../igb/igb_ethtool.c:834:32: warning: incorrect type in assignment (different
>base types)
>.../igb/igb_ethtool.c:834:32:    expected unsigned short [usertype]
>.../igb/igb_ethtool.c:834:32:    got restricted __le16 [usertype]
>  CHECK   .../igc/igc_ethtool.c
>.../igc/igc_ethtool.c:555:32: warning: incorrect type in assignment (different base
>types)
>.../igc/igc_ethtool.c:555:32:    expected unsigned short [usertype]
>.../igc/igc_ethtool.c:555:32:    got restricted __le16 [usertype]
>---
> drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 2 +-
> drivers/net/ethernet/intel/igb/igb_ethtool.c     | 2 +-
> drivers/net/ethernet/intel/igc/igc_ethtool.c     | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
Tested-by: Dave Switzer <david.switzer at intel.com>
 



More information about the Intel-wired-lan mailing list