[PATCH] Input: synaptics-rmi4 - change a char type to u8

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE3419d

2 messages, 2 authors, 2017-05-30 · open the first message on its own page

[PATCH] Input: synaptics-rmi4 - change a char type to u8

From: Dan Carpenter <hidden>
Date: 2017-05-03 21:23:34

Smatch doesn't like when we use "%02X" to print char types because,
what about if it's a negative?

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/input/rmi4/rmi_f34v7.c b/drivers/input/rmi4/rmi_f34v7.c
index 10c0d11b72c9..ae2db1c3aebf 100644
--- a/drivers/input/rmi4/rmi_f34v7.c
+++ b/drivers/input/rmi4/rmi_f34v7.c
@@ -518,7 +518,7 @@ static int rmi_f34v7_read_queries(struct f34_data *f34)
 			query_1_7.partition_support[1] & HAS_GUEST_CODE;
 
 	if (query_0 & HAS_CONFIG_ID) {
-		char f34_ctrl[CONFIG_ID_SIZE];
+		u8 f34_ctrl[CONFIG_ID_SIZE];
 		int i = 0;
 		u8 *p = f34->configuration_id;
 		*p = '\0';

Re: [PATCH] Input: synaptics-rmi4 - change a char type to u8

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2017-05-30 03:21:46

On Thu, May 04, 2017 at 12:23:19AM +0300, Dan Carpenter wrote:
Smatch doesn't like when we use "%02X" to print char types because,
what about if it's a negative?
Applied, thank you. Furthermore, I think we could reduce it to using %ph
instead of that loop.
quoted hunk
Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/input/rmi4/rmi_f34v7.c b/drivers/input/rmi4/rmi_f34v7.c
index 10c0d11b72c9..ae2db1c3aebf 100644
--- a/drivers/input/rmi4/rmi_f34v7.c
+++ b/drivers/input/rmi4/rmi_f34v7.c
@@ -518,7 +518,7 @@ static int rmi_f34v7_read_queries(struct f34_data *f34)
 			query_1_7.partition_support[1] & HAS_GUEST_CODE;
 
 	if (query_0 & HAS_CONFIG_ID) {
-		char f34_ctrl[CONFIG_ID_SIZE];
+		u8 f34_ctrl[CONFIG_ID_SIZE];
 		int i = 0;
 		u8 *p = f34->configuration_id;
 		*p = '\0';
Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help