The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Leo L. Schwab" <ewhac@ewhac.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: spaceball - fix parsing of movement data packets
Date: Tue, 21 Dec 2021 02:00:17 -0800	[thread overview]
Message-ID: <YcGlsVKeJi7E0dWj@ewhac.org> (raw)
In-Reply-To: <YcBF6bnRjYRMp2Cq@google.com>

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

      reply	other threads:[~2021-12-21 10:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  4:06 [PATCH] Input: spaceball - fix parsing of movement data packets Leo L. Schwab
2021-12-16  8:58 ` Leo L. Schwab
2021-12-20  8:59 ` Dmitry Torokhov
2021-12-21 10:00   ` Leo L. Schwab [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=YcGlsVKeJi7E0dWj@ewhac.org \
    --to=ewhac@ewhac.org \
    --cc=dmitry.torokhov@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