[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YcGlsVKeJi7E0dWj@ewhac.org>
Date: Tue, 21 Dec 2021 02:00:17 -0800
From: "Leo L. Schwab" <ewhac@...ac.org>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Input: spaceball - fix parsing of movement data packets
On Mon, Dec 20, 2021 at 12:59:21AM -0800, Dmitry Torokhov wrote:
> Could we write
>
> for (i == 0; i < ARRAY_SIZE(spaceball_axes); i++)
> input_report_abs(dev, spaceball_axes[i],
> (__s16)(get_unaligned_be16(&data[i * 2]);
>
> instead?
>
It's not as readable, but sure, I could do that.
> for (i == 0; i < ARRAY_SIZE(spaceball_axes); i++)
^^
Pretty sure you didn't mean that :-).
> input_report_abs(dev, spaceball_axes[i],
> (__s16)(get_unaligned_be16(&data[i * 2]);
^^^^^^^
I'm new here, but it seems odd that an array index (shift plus add
to the base pointer) is preferred over a direct pointer reference.
> (__s16)(get_unaligned_be16(&data[i * 2]);
^^^^^^^^^^^^^^^^^^
Ooo! Didn't know about this; thank you!
Schwab
Powered by blists - more mailing lists