> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Jacek Kowalski
> Sent: Wednesday, July 23, 2025 10:55 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 4/5] igc: drop
> unnecessary constant casts to u16
>
> Remove unnecessary casts of constant values to u16.
> C's integer promotion rules make them ints no matter what.
>
> Signed-off-by: Jacek Kowalski <[email protected]>
> Suggested-by: Simon Horman <[email protected]>
Reviewed-by: Aleksandr Loktionov <[email protected]>
> ---
> drivers/net/ethernet/intel/igc/igc_i225.c | 2 +-
> drivers/net/ethernet/intel/igc/igc_nvm.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c
> b/drivers/net/ethernet/intel/igc/igc_i225.c
> index 0dd61719f1ed..5226d10cc95b 100644
> --- a/drivers/net/ethernet/intel/igc/igc_i225.c
> +++ b/drivers/net/ethernet/intel/igc/igc_i225.c
> @@ -435,7 +435,7 @@ static s32 igc_update_nvm_checksum_i225(struct
> igc_hw *hw)
> }
> checksum += nvm_data;
> }
> - checksum = (u16)NVM_SUM - checksum;
> + checksum = NVM_SUM - checksum;
> ret_val = igc_write_nvm_srwr(hw, NVM_CHECKSUM_REG, 1,
> &checksum);
> if (ret_val) {
> diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.c
> b/drivers/net/ethernet/intel/igc/igc_nvm.c
> index efd121c03967..a47b8d39238c 100644
> --- a/drivers/net/ethernet/intel/igc/igc_nvm.c
> +++ b/drivers/net/ethernet/intel/igc/igc_nvm.c
> @@ -123,7 +123,7 @@ s32 igc_validate_nvm_checksum(struct igc_hw *hw)
> checksum += nvm_data;
> }
>
> - if (checksum != (u16)NVM_SUM) {
> + if (checksum != NVM_SUM) {
> hw_dbg("NVM Checksum Invalid\n");
> ret_val = -IGC_ERR_NVM;
> goto out;
> @@ -155,7 +155,7 @@ s32 igc_update_nvm_checksum(struct igc_hw *hw)
> }
> checksum += nvm_data;
> }
> - checksum = (u16)NVM_SUM - checksum;
> + checksum = NVM_SUM - checksum;
> ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1,
> &checksum);
> if (ret_val)
> hw_dbg("NVM Write Error while updating checksum.\n");
> --
> 2.47.2