mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: "José Expósito" <jose.exposito89@gmail.com>
Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: uclogic: Fix frame templates for big endian architectures
Date: Mon, 14 Nov 2022 15:03:14 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2211141503020.6045@cbobk.fhfr.pm> (raw)
In-Reply-To: <20221110174918.398567-1-jose.exposito89@gmail.com>

On Thu, 10 Nov 2022, José Expósito wrote:

> When parsing a frame template with a placeholder indicating the number
> of buttons present on the frame its value was incorrectly set on big
> endian architectures due to double little endian conversion.
> 
> In order to reproduce the issue and verify the fix, run the HID KUnit
> tests on the PowerPC architecture:
> 
>   $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/hid \
>     --arch=powerpc --cross_compile=powerpc64-linux-gnu-
> 
> Fixes: 867c89254425 ("HID: uclogic: Allow to generate frame templates")
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> ---
>  drivers/hid/hid-uclogic-rdesc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c
> index 4bd54c4fb5b0..6b73eb0df6bd 100644
> --- a/drivers/hid/hid-uclogic-rdesc.c
> +++ b/drivers/hid/hid-uclogic-rdesc.c
> @@ -1193,7 +1193,7 @@ __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
>  			   p[sizeof(btn_head)] < param_num) {
>  			v = param_list[p[sizeof(btn_head)]];
>  			put_unaligned((__u8)0x2A, p); /* Usage Maximum */
> -			put_unaligned_le16((__force u16)cpu_to_le16(v), p + 1);
> +			put_unaligned((__force u16)cpu_to_le16(v), (s16 *)(p + 1));
>  			p += sizeof(btn_head) + 1;
>  		} else {

Applied to hid.git#for-6.1/upstream-fixes, thanks José.

-- 
Jiri Kosina
SUSE Labs


      reply	other threads:[~2022-11-14 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 17:49 José Expósito
2022-11-14 14:03 ` Jiri Kosina [this message]

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=nycvar.YFH.7.76.2211141503020.6045@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jose.exposito89@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®