Skip to content

Commit

Permalink
HID: i2c-hid: fix harmless test_bit() issue
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Dan Carpenter authored and Jiri Kosina committed May 18, 2015
1 parent af43c40 commit c8fd51d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/hid/i2c-hid/i2c-hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
#include <linux/i2c/i2c-hid.h>

/* flags */
#define I2C_HID_STARTED (1 << 0)
#define I2C_HID_RESET_PENDING (1 << 1)
#define I2C_HID_READ_PENDING (1 << 2)
#define I2C_HID_STARTED 0
#define I2C_HID_RESET_PENDING 1
#define I2C_HID_READ_PENDING 2

#define I2C_HID_PWR_ON 0x00
#define I2C_HID_PWR_SLEEP 0x01
Expand Down

0 comments on commit c8fd51d

Please sign in to comment.