Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5576983rwb; Mon, 14 Nov 2022 06:41:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf5vYBgLcqI57y26yTN0pGa4rjxaDrwNAbqdhtTgERAb+BMc91oIPQVOLlScV3iVyKHpNqpc X-Received: by 2002:a17:902:9894:b0:17f:7771:dde1 with SMTP id s20-20020a170902989400b0017f7771dde1mr14234419plp.125.1668436883817; Mon, 14 Nov 2022 06:41:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668436883; cv=none; d=google.com; s=arc-20160816; b=gQkiSWYtMU/enpQj/A+P93Q4HTy04Tcblnni7xfGiHibwA0oY3+Ph5iiQe0Z+bimwN rBLzHFrvweVOGP9AAGqBnB1iyMK/rPZTzBMR+iV5LGHE3wyXQKXh4fQHMcBYAHLH10zX 5IIxQz5vSsQZGgdoubzUjOAhOmrYTMtEOLd660iFr1SpeaXF9fCGAdc9pQHEf+eMszQD 3XYBTNvVKc0bO99dTAM64jDikgeprEON8rZcj3u5JBomXWUUD1GBDsi5AvVHubAtT6lK zT/fU5DTUNWRNk0QrYc+/rH75g6LfYpFlTl7CuWUAxTI7WswNNdoQIOKKo76tjofsvl6 QmqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=hl9XEgBZGHTzXoopX/a6bzp566oyeMyGki9KWgp/R1w=; b=jiH2trsFIik4x12h3/9utyDfqhc7ljoL74pAHnxjLbEoLE4qh2xw7nfnpd//bgWfWa NI3Qq/UTXgLCYai3YCG4qOy2bdiC3GGRCbo/7MZcKelPcTRX+XM+bp+ZBJOGleM7sVtb BQjM8r+DZT8/dn7v0kdzRzCVRbb1ue52dXnFoxq+czXD2i29HHptI5pXPET7bdjEasLZ /vBmQaYkPDtxwB5LLD9lU/8pCF0LOs6rVNGV0LazCT5pIaB4+JgGytO0PCSu+nY3m1Gl Sk1p7rOmgK9yA+38feY22vFXDO7sT2cCoaTC5/Xs4A9Ydb/a20Sax6SaliEsEHaYHXof U9KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cli7xA2q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a1709028f8a00b0016bf245fbe1si8923160plo.296.2022.11.14.06.41.07; Mon, 14 Nov 2022 06:41:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cli7xA2q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236658AbiKNOEE (ORCPT + 87 others); Mon, 14 Nov 2022 09:04:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236719AbiKNODT (ORCPT ); Mon, 14 Nov 2022 09:03:19 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE0BC2AC75; Mon, 14 Nov 2022 06:03:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 82B46B80F91; Mon, 14 Nov 2022 14:03:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33777C433C1; Mon, 14 Nov 2022 14:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668434596; bh=MUvSTgHOHNFDpAL2hFpOgTLtI7jmWOp30r5+jRyuvvg=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=cli7xA2q8GmnA1bTRkzFFKoYOEy8ffVbJ4oO3j5hmsuNRKUVmlAUxXtaQrgq+yZOG 3hKXdBS36zkhDnDLmRkA1WTcfD6XA2qil5PkNTiQSrd/rQk8v46YKh4UnhdqR36f1V lWIEPWheqkOhkrqsqJbssb7eVvWadWzi8shpkENyox15O4Fz2LdCY3hpMIlCngKu10 hZ5j5hS5Q73bmCBc+mMz/vssRhtXJHB2VZJu6LlJCm0A0wnM7kyAtbhx9YTohM50XZ eseTZjrhb1E+ofCT9Q7ql/9bk4hidD5vtH23GJP2jQWAXqBpw25QX2Qw35iFcntwdn 11rRbiA9imf2Q== Date: Mon, 14 Nov 2022 15:03:14 +0100 (CET) From: Jiri Kosina To: =?ISO-8859-15?Q?Jos=E9_Exp=F3sito?= 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 In-Reply-To: <20221110174918.398567-1-jose.exposito89@gmail.com> Message-ID: References: <20221110174918.398567-1-jose.exposito89@gmail.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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