lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <IA3PR11MB89861CD793372D790961D65AE55FA@IA3PR11MB8986.namprd11.prod.outlook.com>
Date: Wed, 23 Jul 2025 10:10:38 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: Jacek Kowalski <jacek@...ekk.info>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
	<przemyslaw.kitszel@...el.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David
 S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, "Jakub
 Kicinski" <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman
	<horms@...nel.org>
CC: "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next v3 5/5] ixgbe: drop unnecessary
 casts to u16 / int



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf
> Of Jacek Kowalski
> Sent: Wednesday, July 23, 2025 10:56 AM
> To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@...el.com>; Andrew Lunn
> <andrew+netdev@...n.ch>; David S. Miller <davem@...emloft.net>; Eric
> Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo
> Abeni <pabeni@...hat.com>; Simon Horman <horms@...nel.org>
> Cc: intel-wired-lan@...ts.osuosl.org; netdev@...r.kernel.org
> 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 <jacek@...ekk.info>
> Suggested-by: Simon Horman <horms@...nel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
> ---
>  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ