From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B16CCC32796 for ; Mon, 22 Aug 2022 19:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238850AbiHVTgC (ORCPT ); Mon, 22 Aug 2022 15:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238768AbiHVTgA (ORCPT ); Mon, 22 Aug 2022 15:36:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9CE1275E; Mon, 22 Aug 2022 12:35:50 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 868AF6122F; Mon, 22 Aug 2022 19:35:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E425AC43141; Mon, 22 Aug 2022 19:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661196948; bh=59bb0jYFlSosGYQkwjxBpEccBGa05dy9L2UhBEaYG+I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=e4u1X1JWq8Fq35+G7oCT0frCJtoXcIPfYBzz2ocV72fIPDu635p+trs2/NJX51Bw+ dgo+DWNHq1pD50EiRAdBEzkcKK3vT+9Aacb/Ii2b7sNZQh2VEXp1Stfw/xPvBSP7TE yEUSUZpbiCwhm85IZbW8DzLkomsacdzLFaXZh2aCVKqStx6LceK2JZBqZEkdt09Oru Jn59ZTfbqB/+T6ZGRuwTfYcwfJcS6gnjL37YLHkn3qHx4o6q7ptzcqvSp2vy9foITX lmbGxorMtEcb0WFe+XxpFFX+6N9/xgRjbImvwZc5tNJQVc9dwnZy0o667r1FWMrLcm IoN/gGcnWyy6Q== Date: Mon, 22 Aug 2022 20:01:20 +0100 From: Jonathan Cameron To: Paul Cercueil Cc: Artur Rojek , Dmitry Torokhov , Chris Morgan , 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 Message-ID: <20220822200120.543ff801@jic23-huawei> In-Reply-To: <3HE0HR.IPKJTTCKEJUA1@crapouillou.net> References: <20220817105643.95710-1-contact@artur-rojek.eu> <20220817105643.95710-5-contact@artur-rojek.eu> <20220819185339.7f488ad8@jic23-huawei> <3HE0HR.IPKJTTCKEJUA1@crapouillou.net> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org > >> 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