Skip to content

Commit c8fd51d

Browse files
Dan CarpenterJiri Kosina
authored andcommitted
HID: i2c-hid: fix harmless test_bit() issue
These defines are used like this: if (test_bit(I2C_HID_STARTED, &ihid->flags)) The intent was to use bits 0, 1, and 2 but because of the extra shifts we're using bits 1, 2, and 4. It's harmless becuase it's done consistently but it's not the intent and static checkers will complain. Fixes: 4a200c3 ('HID: i2c-hid: introduce HID over i2c specification implementation') Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent af43c40 commit c8fd51d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/hid/i2c-hid/i2c-hid.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
#include <linux/i2c/i2c-hid.h>
4343

4444
/* flags */
45-
#define I2C_HID_STARTED (1 << 0)
46-
#define I2C_HID_RESET_PENDING (1 << 1)
47-
#define I2C_HID_READ_PENDING (1 << 2)
45+
#define I2C_HID_STARTED 0
46+
#define I2C_HID_RESET_PENDING 1
47+
#define I2C_HID_READ_PENDING 2
4848

4949
#define I2C_HID_PWR_ON 0x00
5050
#define I2C_HID_PWR_SLEEP 0x01

0 commit comments

Comments
 (0)