From: Jonathan Cameron <jic23@kernel.org>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Artur Rojek <contact@artur-rojek.eu>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Chris Morgan <macromorgan@hotmail.com>,
linux-mips@vger.kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH 4/4] input: joystick: Fix buffer data parsing
Date: Mon, 22 Aug 2022 20:01:20 +0100 [thread overview]
Message-ID: <20220822200120.543ff801@jic23-huawei> (raw)
In-Reply-To: <3HE0HR.IPKJTTCKEJUA1@crapouillou.net>
> >> case 2:
> >> - data_u16 = (const u16 *)data + idx;
> >> -
> >> /*
> >> * Data is aligned to the sample size by IIO core.
> >> * Call `get_unaligned_xe16` to hide type casting.
> >> */
> >> if (endianness == IIO_BE)
> >> - val = get_unaligned_be16(data_u16);
> >> + val = get_unaligned_be16(chan_data);
> >
> > I obviously missed this previously but these are aligned so we don't
> > need the
> > unaligned form.
>
> Yes, the comment above says that it's used to hide type casting.
oops :)
Thanks for pointing out my lack of observation!
Jonathan
next prev parent reply other threads:[~2022-08-22 19:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-17 10:56 [PATCH 0/4] iio/adc-joystick: buffer data parsing fixes Artur Rojek
2022-08-17 10:56 ` [PATCH 1/4] iio/adc: ingenic: fix channel offsets in buffer Artur Rojek
2022-08-19 8:12 ` Andy Shevchenko
2022-08-19 10:07 ` Paul Cercueil
2022-08-19 10:15 ` Andy Shevchenko
2022-08-17 10:56 ` [PATCH 2/4] iio: add iio_channel_cb_get_iio_buffer helper Artur Rojek
2022-08-19 8:14 ` Andy Shevchenko
2022-08-19 17:35 ` Jonathan Cameron
2022-08-19 17:44 ` Jonathan Cameron
2022-08-17 10:56 ` [PATCH 3/4] iio: add helper function for reading channel offset in buffer Artur Rojek
2022-08-19 8:17 ` Andy Shevchenko
2022-08-19 10:33 ` Artur Rojek
2022-08-19 10:36 ` Andy Shevchenko
2022-08-19 17:49 ` Jonathan Cameron
2022-08-17 10:56 ` [PATCH 4/4] input: joystick: Fix buffer data parsing Artur Rojek
2022-08-19 8:21 ` Andy Shevchenko
2022-08-19 17:53 ` Jonathan Cameron
2022-08-22 9:03 ` Paul Cercueil
2022-08-22 19:01 ` Jonathan Cameron [this message]
2022-08-18 18:28 ` [PATCH 0/4] iio/adc-joystick: buffer data parsing fixes Chris Morgan
2022-08-19 10:36 ` Artur Rojek
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=20220822200120.543ff801@jic23-huawei \
--to=jic23@kernel.org \
--cc=contact@artur-rojek.eu \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=macromorgan@hotmail.com \
--cc=paul@crapouillou.net \
/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).