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: <20251221185716.65b442d9@jic23-huawei>
Date: Sun, 21 Dec 2025 18:57:16 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: David Lechner <dlechner@...libre.com>
Cc: Ajith Anandhan <ajithanandhan0406@...il.com>, nuno.sa@...log.com,
 andy@...nel.org, robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
 linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] iio: adc: Add support for TI ADS1120

On Mon, 15 Dec 2025 11:42:15 -0600
David Lechner <dlechner@...libre.com> wrote:

> On 12/15/25 10:49 AM, Ajith Anandhan wrote:
> > On 12/15/25 10:06 PM, David Lechner wrote:  
> >> On 12/15/25 10:13 AM, Ajith Anandhan wrote:  
> >>> On 11/18/25 7:34 PM, David Lechner wrote:  
> >>>> On 11/9/25 8:11 AM, Ajith Anandhan wrote:  
> >>>>> Add driver for the Texas Instruments ADS1120, a precision 16-bit
> >>>>> analog-to-digital converter with an SPI interface.
> >>>>>  
> >>>> ...
> >>>>  
> >>>>> +#define ADS1120_CFG0_GAIN_MASK        GENMASK(3, 1)
> >>>>> +#define ADS1120_CFG0_GAIN_1        0
> >>>>> +#define ADS1120_CFG0_GAIN_2        1
> >>>>> +#define ADS1120_CFG0_GAIN_4        2
> >>>>> +#define ADS1120_CFG0_GAIN_8        3
> >>>>> +#define ADS1120_CFG0_GAIN_16        4
> >>>>> +#define ADS1120_CFG0_GAIN_32        5
> >>>>> +#define ADS1120_CFG0_GAIN_64        6
> >>>>> +#define ADS1120_CFG0_GAIN_128        7  
> >>>> We could avoid these macros by just doing ilog2(gain).  
> >>>
> >>> I understand your concern about unused macros. I've kept them for documentation purposes as they map directly to the datasheet register definitions, which makes it easier to verify correctness against hardware specs also I'd prefer to keep it like this since it give more readability Shall i keep this as it is for this initial version?  
> >> I would argue that if they aren't being used then omitting them would
> >> save us the time of having to verify the correctness in the first place.
> >>  
> > I understand your concern about unused macros. This was suggested by Jonathan earlier.  
> 
> Jonathan is the maintainer, so if he is fine with it, he has the final say. :-)

I don't care strongly either way.  Personally I slightly prefer
to see full definition of a specific register rather than just some
fields so we now what else is being written to 0.  For the
case of registers that aren't touched at all it can be a lot
of noise to define them if there are lots of them. For one
or two it can be better to just do it even if they aren't used.

Anyhow, I'm not going to be fussy about it either way!

Jonathan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ