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]
Message-ID: <pnd7c1enflq.fsf@axis.com>
Date: Sun, 15 Jun 2025 00:05:53 +0200
From: Waqar Hameed <waqar.hameed@...s.com>
To: Jonathan Cameron <jic23@...nel.org>
CC: Lars-Peter Clausen <lars@...afoo.de>, <kernel@...s.com>,
	<linux-kernel@...r.kernel.org>, <linux-iio@...r.kernel.org>
Subject: Re: [PATCH 3/3] iio: Add driver for Nicera D3-323-AA PIR sensor

On Fri, May 16, 2025 at 19:16 +0200 Waqar Hameed <waqar.hameed@...s.com> wrote:

> On Sun, May 11, 2025 at 13:14 +0100 Jonathan Cameron <jic23@...nel.org> wrote:

[...]

>>> +
>>> +/*
>>> + * Register bitmap.
>>> + * For some reason the first bit is denoted as F37 in the datasheet, the second
>>> + * as F38 and so on. Note the gap between F60 and F64.
>>> + */
>>> +#define D3323AA_REG_BIT_SLAVEA1		0	/* F37. */
>>> +#define D3323AA_REG_BIT_SLAVEA2		1	/* F38. */
>>> +#define D3323AA_REG_BIT_SLAVEA3		2	/* F39. */
>>> +#define D3323AA_REG_BIT_SLAVEA4		3	/* F40. */
>>> +#define D3323AA_REG_BIT_SLAVEA5		4	/* F41. */
>>> +#define D3323AA_REG_BIT_SLAVEA6		5	/* F42. */
>>> +#define D3323AA_REG_BIT_SLAVEA7		6	/* F43. */
>>> +#define D3323AA_REG_BIT_SLAVEA8		7	/* F44. */
>>> +#define D3323AA_REG_BIT_SLAVEA9		8	/* F45. */
>> Perhaps these can be represented as masks using GENMASK() rather than
>> bits.  A lot of this will be hidden away if you follow suggesting to
>> only expose that you are using a bitmap to bitbang in the read/write
>> functions.
>
> Yes, that would be the natural thing to do when moving the bitmap stuff
> to the read/write functions (as answered below).

Since `bitmap_write()` needs an offset (and size), I didn't use
`GENMASK()` in v2 and thought it would be more clear this way. I'm still
open for suggestions though.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ