* [patch] HID: i2c-hid: fix harmless test_bit() issue
@ 2015-05-14 8:33 ` Dan Carpenter
0 siblings, 0 replies; 6+ 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] 6+ messages in thread
* [patch] HID: i2c-hid: fix harmless test_bit() issue
@ 2015-05-14 8:33 ` Dan Carpenter
0 siblings, 0 replies; 6+ 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] 6+ messages in thread
* Re: [patch] HID: i2c-hid: fix harmless test_bit() issue
2015-05-14 8:33 ` Dan Carpenter
@ 2015-05-14 14:17 ` Benjamin Tissoires
-1 siblings, 0 replies; 6+ messages in thread
From: Benjamin Tissoires @ 2015-05-14 14:17 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jiri Kosina, Mika Westerberg, Antonio Borneo,
Jean-Baptiste Maneyrol, Andrew Duggan, Gwendal Grignou,
Rafael J. Wysocki, linux-input, kernel-janitors, Joe Perches
On May 14 2015 or thereabouts, Dan Carpenter wrote:
> 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>
Same as the other one:
Oops. Looks good to me:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cheers,
Benjamin
>
> 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 [flat|nested] 6+ messages in thread
* Re: [patch] HID: i2c-hid: fix harmless test_bit() issue
@ 2015-05-14 14:17 ` Benjamin Tissoires
0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Tissoires @ 2015-05-14 14:17 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jiri Kosina, Mika Westerberg, Antonio Borneo,
Jean-Baptiste Maneyrol, Andrew Duggan, Gwendal Grignou,
Rafael J. Wysocki, linux-input, kernel-janitors, Joe Perches
On May 14 2015 or thereabouts, Dan Carpenter wrote:
> 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>
Same as the other one:
Oops. Looks good to me:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cheers,
Benjamin
>
> 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 [flat|nested] 6+ messages in thread
* Re: [patch] HID: i2c-hid: fix harmless test_bit() issue
2015-05-14 8:33 ` Dan Carpenter
@ 2015-05-18 9:24 ` Jiri Kosina
-1 siblings, 0 replies; 6+ messages in thread
From: Jiri Kosina @ 2015-05-18 9:24 UTC (permalink / raw)
To: Dan Carpenter
Cc: Benjamin Tissoires, Mika Westerberg, Antonio Borneo,
Jean-Baptiste Maneyrol, Andrew Duggan, Gwendal Grignou,
Rafael J. Wysocki, linux-input, kernel-janitors, Joe Perches
On Thu, 14 May 2015, Dan Carpenter wrote:
> 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>
Applied to for-4.2/upstream, thanks Dan.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] HID: i2c-hid: fix harmless test_bit() issue
@ 2015-05-18 9:24 ` Jiri Kosina
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Kosina @ 2015-05-18 9:24 UTC (permalink / raw)
To: Dan Carpenter
Cc: Benjamin Tissoires, Mika Westerberg, Antonio Borneo,
Jean-Baptiste Maneyrol, Andrew Duggan, Gwendal Grignou,
Rafael J. Wysocki, linux-input, kernel-janitors, Joe Perches
On Thu, 14 May 2015, Dan Carpenter wrote:
> 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>
Applied to for-4.2/upstream, thanks Dan.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-18 9:24 UTC | newest]
Thread overview: 6+ 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 8:33 ` Dan Carpenter
2015-05-14 14:17 ` Benjamin Tissoires
2015-05-14 14:17 ` Benjamin Tissoires
2015-05-18 9:24 ` Jiri Kosina
2015-05-18 9:24 ` Jiri Kosina
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.