Skip to contentSkip to conversation

HID: rmi: fix some harmless BIT() mistakes

PATCH Applied Dan Carpenter 3 participants 3 messages May 14, 2015 – May 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: rmi: fix some harmless BIT() mistakes

These defines are used like this:

	if (!(test_bit(RMI_STARTED, &hdata->flags)))

So the intent was to use bits 0, 1 and 2 but because of the extra BIT() shifts we're actually using 1, 2 and 4. It's harmless because it's done consistently but static checkers will complain.

Fixes 9fb6bf02e3ad ('HID: rmi: introduce RMI driver for Synaptics touchpads')
drivers/hid/hid-rmi.c +3 -3
index 368ffdf..2f3e51d 100644
@@ -29,9 +29,9 @@
 #define RMI_SET_RMI_MODE_REPORT_ID	0x0f /* Feature Report */
 
 /* flags */
-#define RMI_READ_REQUEST_PENDING	BIT(0)
-#define RMI_READ_DATA_PENDING		BIT(1)
-#define RMI_STARTED			BIT(2)
+#define RMI_READ_REQUEST_PENDING	0
+#define RMI_READ_DATA_PENDING		1
+#define RMI_STARTED			2
 
 /* device flags */
 #define RMI_DEVICE			BIT(0)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Dan Carpenter

These defines are used like this:

	if (!(test_bit(RMI_STARTED, &hdata->flags)))

So the intent was to use bits 0, 1 and 2 but because of the extra BIT() shifts we're actually using 1, 2 and 4. It's harmless because it's done consistently but static checkers will complain.

Fixes 9fb6bf02e3ad ('HID: rmi: introduce RMI driver for Synaptics touchpads')

Oops. Looks good to me:

Cheers,
Benjamin

Quoted 18 lines
drivers/hid/hid-rmi.c +3 -3
index 368ffdf..2f3e51d 100644
@@ -29,9 +29,9 @@
 #define RMI_SET_RMI_MODE_REPORT_ID	0x0f /* Feature Report */
 
 /* flags */
-#define RMI_READ_REQUEST_PENDING	BIT(0)
-#define RMI_READ_DATA_PENDING		BIT(1)
-#define RMI_STARTED			BIT(2)
+#define RMI_READ_REQUEST_PENDING	0
+#define RMI_READ_DATA_PENDING		1
+#define RMI_STARTED			2
 
 /* device flags */
 #define RMI_DEVICE			BIT(0)
Applied
#2 lore raw
In reply to Dan Carpenter
Quoted 16 lines · Dan Carpenter

These defines are used like this:

	if (!(test_bit(RMI_STARTED, &hdata->flags)))

So the intent was to use bits 0, 1 and 2 but because of the extra BIT() shifts we're actually using 1, 2 and 4. It's harmless because it's done consistently but static checkers will complain.

Fixes 9fb6bf02e3ad ('HID: rmi: introduce RMI driver for Synaptics touchpads')
drivers/hid/hid-rmi.c +0 -0
index 368ffdf..2f3e51d 100644

drivers/hid/hid-rmi.c line 34

Quoted 9 lines
drivers/hid/hid-rmi.c +3 -3
@@ -29,9 +29,9 @@
 #define RMI_SET_RMI_MODE_REPORT_ID	0x0f /* Feature Report */
 
 /* flags */
-#define RMI_READ_REQUEST_PENDING	BIT(0)
-#define RMI_READ_DATA_PENDING		BIT(1)
-#define RMI_STARTED			BIT(2)
+#define RMI_READ_REQUEST_PENDING	0
+#define RMI_READ_DATA_PENDING		1
+#define RMI_STARTED			2

Applied to for-4.2/upstream, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs