Skip to content

Commit d45109c

Browse files
pnewman-ctigregkh
authored andcommitted
misc: eeprom: eeprom_93cx6: Switch to BIT() macro
Use the BIT() macro rather than (1 << (i - 1)). Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Parker Newman <[email protected]> Link: https://lore.kernel.org/r/f40d21d284816a62003975e237a58b489d77c7d4.1727880931.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7738a7a commit d45109c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/misc/eeprom/eeprom_93cx6.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Supported chipsets: 93c46 & 93c66.
99
*/
1010

11+
#include <linux/bits.h>
1112
#include <linux/kernel.h>
1213
#include <linux/module.h>
1314
#include <linux/delay.h>
@@ -102,7 +103,7 @@ static void eeprom_93cx6_write_bits(struct eeprom_93cx6 *eeprom,
102103
/*
103104
* Check if this bit needs to be set.
104105
*/
105-
eeprom->reg_data_in = !!(data & (1 << (i - 1)));
106+
eeprom->reg_data_in = !!(data & BIT(i - 1));
106107

107108
/*
108109
* Write the bit to the eeprom register.
@@ -152,7 +153,7 @@ static void eeprom_93cx6_read_bits(struct eeprom_93cx6 *eeprom,
152153
* Read if the bit has been set.
153154
*/
154155
if (eeprom->reg_data_out)
155-
buf |= (1 << (i - 1));
156+
buf |= BIT(i - 1);
156157

157158
eeprom_93cx6_pulse_low(eeprom);
158159
}

0 commit comments

Comments
 (0)