lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ