linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>,
	Mark Brown <broonie@kernel.org>,
	kernel test robot <lkp@intel.com>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, linux-spi@vger.kernel.org,
	David Jander <david@protonic.nl>
Subject: Re: [PATCH v1] Input: ads7846: ads7846_get_value - fix unaligned pointer value warning
Date: Thu, 9 Sep 2021 22:04:16 -0700	[thread overview]
Message-ID: <YTrnUFI53iwvwxrj@google.com> (raw)
In-Reply-To: <20210707124115.20028-1-o.rempel@pengutronix.de>

Hi Oleksij,

On Wed, Jul 07, 2021 at 02:41:15PM +0200, Oleksij Rempel wrote:
> Fix warning reported by the kernel test robot:
> drivers/input/touchscreen/ads7846.c:705:24: warning: taking address
> of packed member 'data' of class or structure 'ads7846_buf' may result
> in an unaligned pointer value [-Waddress-of-packed-member]
> 
> Fixes: 6965eece2a89 ("Input: ads7846 - convert to one message")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/input/touchscreen/ads7846.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index adb4c2230c31..1987dedac94f 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -702,7 +702,7 @@ static int ads7846_get_value(struct ads7846_buf *buf)
>  {
>  	int value;
>  
> -	value = be16_to_cpup(&buf->data);
> +	value = get_unaligned_be16(&buf->data);

ds7846_buf is declared as packed so I believe using be16_to_cpu(buf->data)
will suffice.

I can adjust on my side if you agree.

Thanks.

-- 
Dmitry

  reply	other threads:[~2021-09-10  5:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 12:41 [PATCH v1] Input: ads7846: ads7846_get_value - fix unaligned pointer value warning Oleksij Rempel
2021-09-10  5:04 ` Dmitry Torokhov [this message]
2021-09-10  7:51   ` Oleksij Rempel
2021-10-17  4:23     ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YTrnUFI53iwvwxrj@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=broonie@kernel.org \
    --cc=david@protonic.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=o.rempel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).