linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: synaptics-rmi4 - change a char type to u8
@ 2017-05-03 21:23 Dan Carpenter
  2017-05-30  3:21 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-05-03 21:23 UTC (permalink / raw)
  To: Dmitry Torokhov, Nick Dyer
  Cc: Benjamin Tissoires, linux-input, kernel-janitors

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 <dan.carpenter@oracle.com>

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';

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

* Re: [PATCH] Input: synaptics-rmi4 - change a char type to u8
  2017-05-03 21:23 [PATCH] Input: synaptics-rmi4 - change a char type to u8 Dan Carpenter
@ 2017-05-30  3:21 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2017-05-30  3:21 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Nick Dyer, Benjamin Tissoires, linux-input, kernel-janitors

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.

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> 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

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

end of thread, other threads:[~2017-05-30  3:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-03 21:23 [PATCH] Input: synaptics-rmi4 - change a char type to u8 Dan Carpenter
2017-05-30  3:21 ` Dmitry Torokhov

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).