linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: adxl34x - fix sparse warning
@ 2021-10-13  2:46 Dmitry Torokhov
  2021-10-13  7:41 ` Uwe Kleine-König
  2021-10-15 15:20 ` Hennerich, Michael
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2021-10-13  2:46 UTC (permalink / raw)
  To: Michael Hennerich; +Cc: Uwe Kleine-König, linux-input, linux-kernel

This fixes the following warning from sparse:

  CC [M]  drivers/input/misc/adxl34x.o
  CHECK   drivers/input/misc/adxl34x.c
drivers/input/misc/adxl34x.c:245:29: warning: cast to restricted __le16
drivers/input/misc/adxl34x.c:248:29: warning: cast to restricted __le16
drivers/input/misc/adxl34x.c:251:29: warning: cast to restricted __le16

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/misc/adxl34x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c
index 34beac80e6f0..a4af314392a9 100644
--- a/drivers/input/misc/adxl34x.c
+++ b/drivers/input/misc/adxl34x.c
@@ -237,7 +237,7 @@ static const struct adxl34x_platform_data adxl34x_default_init = {
 
 static void adxl34x_get_triple(struct adxl34x *ac, struct axis_triple *axis)
 {
-	short buf[3];
+	__le16 buf[3];
 
 	ac->bops->read_block(ac->dev, DATAX0, DATAZ1 - DATAX0 + 1, buf);
 
-- 
2.33.0.882.g93a45727a2-goog


-- 
Dmitry

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

* Re: [PATCH] Input: adxl34x - fix sparse warning
  2021-10-13  2:46 [PATCH] Input: adxl34x - fix sparse warning Dmitry Torokhov
@ 2021-10-13  7:41 ` Uwe Kleine-König
  2021-10-15 15:20 ` Hennerich, Michael
  1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2021-10-13  7:41 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Michael Hennerich, linux-input, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 879 bytes --]

On Tue, Oct 12, 2021 at 07:46:37PM -0700, Dmitry Torokhov wrote:
> This fixes the following warning from sparse:
> 
>   CC [M]  drivers/input/misc/adxl34x.o
>   CHECK   drivers/input/misc/adxl34x.c
> drivers/input/misc/adxl34x.c:245:29: warning: cast to restricted __le16
> drivers/input/misc/adxl34x.c:248:29: warning: cast to restricted __le16
> drivers/input/misc/adxl34x.c:251:29: warning: cast to restricted __le16

This was introduced (I think) in commit

	e27c729219ad ("Input: add driver for ADXL345/346 Digital Accelerometers")

. Is this worth a Fixes: line, or mentioning in the commit log?

Other than that:

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* RE: [PATCH] Input: adxl34x - fix sparse warning
  2021-10-13  2:46 [PATCH] Input: adxl34x - fix sparse warning Dmitry Torokhov
  2021-10-13  7:41 ` Uwe Kleine-König
@ 2021-10-15 15:20 ` Hennerich, Michael
  1 sibling, 0 replies; 3+ messages in thread
From: Hennerich, Michael @ 2021-10-15 15:20 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Uwe Kleine-König, linux-input, linux-kernel

> -----Original Message-----
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Sent: Mittwoch, 13. Oktober 2021 04:47
> To: Hennerich, Michael <Michael.Hennerich@analog.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] Input: adxl34x - fix sparse warning
> 
> This fixes the following warning from sparse:
> 
>   CC [M]  drivers/input/misc/adxl34x.o
>   CHECK   drivers/input/misc/adxl34x.c
> drivers/input/misc/adxl34x.c:245:29: warning: cast to restricted __le16
> drivers/input/misc/adxl34x.c:248:29: warning: cast to restricted __le16
> drivers/input/misc/adxl34x.c:251:29: warning: cast to restricted __le16
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

> ---
>  drivers/input/misc/adxl34x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c index
> 34beac80e6f0..a4af314392a9 100644
> --- a/drivers/input/misc/adxl34x.c
> +++ b/drivers/input/misc/adxl34x.c
> @@ -237,7 +237,7 @@ static const struct adxl34x_platform_data
> adxl34x_default_init = {
> 
>  static void adxl34x_get_triple(struct adxl34x *ac, struct axis_triple *axis)  {
> -	short buf[3];
> +	__le16 buf[3];
> 
>  	ac->bops->read_block(ac->dev, DATAX0, DATAZ1 - DATAX0 + 1, buf);
> 
> --
> 2.33.0.882.g93a45727a2-goog
> 
> 
> --
> Dmitry

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

end of thread, other threads:[~2021-10-15 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  2:46 [PATCH] Input: adxl34x - fix sparse warning Dmitry Torokhov
2021-10-13  7:41 ` Uwe Kleine-König
2021-10-15 15:20 ` Hennerich, Michael

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