]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ixgbe: drop unnecessary casts to u16 / int
authorJacek Kowalski <jacek@jacekk.info>
Wed, 23 Jul 2025 08:55:37 +0000 (10:55 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 3 Sep 2025 17:07:27 +0000 (10:07 -0700)
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@jacekk.info>
Suggested-by: Simon Horman <horms@kernel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

index 4ff19426ab74280ef3da50343d9e058942394b72..3ea6765f9c5d83691b7c01db3dca68e88ce8e174 100644 (file)
@@ -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;
 }
 
 /**
index c2353aed012041ad883bc02256488e33c954d1e0..e67e2feb045b38c35881cbf5954905565f3f04ee 100644 (file)
@@ -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;
 }
 
 /**
index bfa647086c708877866b2007e1641e385188e86f..650c3e522c3ebf941dfdcc181d197d85ef63daf9 100644 (file)
@@ -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