> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Jacek Kowalski
> Sent: Wednesday, July 23, 2025 10:56 AM
> To: Nguyen, Anthony L <[email protected]>; Kitszel,
> Przemyslaw <[email protected]>; Andrew Lunn
> <[email protected]>; David S. Miller <[email protected]>; Eric
> Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo
> Abeni <[email protected]>; Simon Horman <[email protected]>
> Cc: [email protected]; [email protected]
> Subject: [Intel-wired-lan] [PATCH iwl-next v3 5/5] ixgbe: drop
> unnecessary casts to u16 / int
>
> Remove unnecessary casts of constant values to u16.
> C's integer promotion rules make them ints no matter what.
>
> Additionally drop cast from u16 to int in return statements.
>
> Signed-off-by: Jacek Kowalski <[email protected]>
> Suggested-by: Simon Horman <[email protected]>
Reviewed-by: Aleksandr Loktionov <[email protected]>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 4 ++--
> drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 4 ++--
> drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> index 4ff19426ab74..3ea6765f9c5d 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> @@ -1739,9 +1739,9 @@ int ixgbe_calc_eeprom_checksum_generic(struct
> ixgbe_hw *hw)
> }
> }
>
> - checksum = (u16)IXGBE_EEPROM_SUM - checksum;
> + checksum = IXGBE_EEPROM_SUM - checksum;
>
> - return (int)checksum;
> + return checksum;
> }
>
> /**
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
> index c2353aed0120..e67e2feb045b 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
> @@ -373,9 +373,9 @@ static int ixgbe_calc_eeprom_checksum_X540(struct
> ixgbe_hw *hw)
> }
> }
>
> - checksum = (u16)IXGBE_EEPROM_SUM - checksum;
> + checksum = IXGBE_EEPROM_SUM - checksum;
>
> - return (int)checksum;
> + return checksum;
> }
>
> /**
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
> index bfa647086c70..650c3e522c3e 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
> @@ -1060,9 +1060,9 @@ static int ixgbe_calc_checksum_X550(struct
> ixgbe_hw *hw, u16 *buffer,
> return status;
> }
>
> - checksum = (u16)IXGBE_EEPROM_SUM - checksum;
> + checksum = IXGBE_EEPROM_SUM - checksum;
>
> - return (int)checksum;
> + return checksum;
> }
>
> /** ixgbe_calc_eeprom_checksum_X550 - Calculates and returns the
> checksum
> --
> 2.47.2