From: Parker Newman Date: Wed, 2 Oct 2024 15:12:34 +0000 (-0400) Subject: misc: eeprom: eeprom_93cx6: Switch to BIT() macro X-Git-Tag: v6.13-rc1~25^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d45109c53272c88afc7db84779d0a845a12ed9fc;p=thirdparty%2Flinux.git misc: eeprom: eeprom_93cx6: Switch to BIT() macro Use the BIT() macro rather than (1 << (i - 1)). Reviewed-by: Andy Shevchenko Signed-off-by: Parker Newman Link: https://lore.kernel.org/r/f40d21d284816a62003975e237a58b489d77c7d4.1727880931.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/eeprom/eeprom_93cx6.c b/drivers/misc/eeprom/eeprom_93cx6.c index 4c9827fe92173..e6f0e0fc1ca20 100644 --- a/drivers/misc/eeprom/eeprom_93cx6.c +++ b/drivers/misc/eeprom/eeprom_93cx6.c @@ -8,6 +8,7 @@ * Supported chipsets: 93c46 & 93c66. */ +#include #include #include #include @@ -102,7 +103,7 @@ static void eeprom_93cx6_write_bits(struct eeprom_93cx6 *eeprom, /* * Check if this bit needs to be set. */ - eeprom->reg_data_in = !!(data & (1 << (i - 1))); + eeprom->reg_data_in = !!(data & BIT(i - 1)); /* * Write the bit to the eeprom register. @@ -152,7 +153,7 @@ static void eeprom_93cx6_read_bits(struct eeprom_93cx6 *eeprom, * Read if the bit has been set. */ if (eeprom->reg_data_out) - buf |= (1 << (i - 1)); + buf |= BIT(i - 1); eeprom_93cx6_pulse_low(eeprom); }