linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] HID: i2c-hid: fix harmless test_bit() issue
@ 2015-05-14  8:33 Dan Carpenter
  2015-05-14 14:17 ` Benjamin Tissoires
  2015-05-18  9:24 ` Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-05-14  8:33 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: Mika Westerberg, Antonio Borneo, Jean-Baptiste Maneyrol,
	Andrew Duggan, Gwendal Grignou, Rafael J. Wysocki, linux-input,
	kernel-janitors, Joe Perches

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: 4a200c3b9a40 ('HID: i2c-hid: introduce HID over i2c specification implementation')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 92d6cdf..cadec6a 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-18  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14  8:33 [patch] HID: i2c-hid: fix harmless test_bit() issue Dan Carpenter
2015-05-14 14:17 ` Benjamin Tissoires
2015-05-18  9:24 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).