> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of 
> Aleksandr Loktionov
> Sent: Wednesday, April 8, 2026 6:12 AM
> To: [email protected]; Nguyen, Anthony L 
> <[email protected]>; Loktionov, Aleksandr 
> <[email protected]>
> Cc: [email protected]; Simon Horman <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-next v2 8/8] ixgbe: use int instead of 
> u32 for error code variables
> 
> The variables used to store return values of kernel and driver functions 
> throughout the ixgbe driver are declared as u32 in several places.  Such 
> functions return negative errno values on error (e.g. -EIO, -EFAULT), > which 
> are sign-extended negative integers.  Storing them in an unsigned
> u32 silently wraps the value: -EIO (0xFFFFFFF7) stored in u32 becomes a large 
> positive number, so any "if (status)" truthiness check still works by 
> accident, but comparisons against specific negative error codes or > 
> propagation up the call stack produce wrong results.
> 
> In the Linux kernel, u32 is reserved for fixed-width quantities used in 
> hardware interfaces or protocol structures.  Using it for generic error codes 
> misleads reviewers into thinking the value is hardware-constrained.
> 
> Change all such local variables from u32 to int driver-wide: one in 
> ixgbe_main.c (ixgbe_resume), three in ixgbe_phy.c 
> (ixgbe_identify_phy_generic, ixgbe_tn_check_overtemp, 
> ixgbe_set_copper_phy_power), and > six in ixgbe_x550.c 
> (ixgbe_check_link_t_X550em, ixgbe_get_lasi_ext_t_x550em, 
> ixgbe_enable_lasi_ext_t_x550em, ixgbe_handle_lasi_ext_t_x550em, 
> ixgbe_ext_phy_t_x550em_get_link, ixgbe_setup_internal_phy_t_x550em).
> 
> No functional change.
> 
> Reviewed-by: Simon Horman <[email protected]>
> Signed-off-by: Aleksandr Loktionov <[email protected]>
> ---
> v1 -> v2:
>  - Carry Reviewed-by: Simon Horman from the IWL posting; add [N/M]
>    numbering; no code change.
> 
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  2 +-  
> drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  |  6 +++---  
> drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 12 ++++++------
>  3 files changed, 10 insertions(+), 10 deletions(-)

Tested-by: Alexander Nowlin <[email protected]>

Reply via email to