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] [thread-next>] [day] [month] [year] [list]
Date: Thu, 30 May 2024 17:45:31 +0300
From: "Ceclan, Dumitru" <mitrutzceclan@...il.com>
To: Nuno Sá <noname.nuno@...il.com>,
 dumitru.ceclan@...log.com
Cc: Lars-Peter Clausen <lars@...afoo.de>,
 Michael Hennerich <Michael.Hennerich@...log.com>,
 Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
 Conor Dooley <conor+dt@...nel.org>, David Lechner <dlechner@...libre.com>,
 linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/6] iio: adc: ad7173: refactor ain and vref selection

On 29/05/2024 15:49, Nuno Sá wrote:
> On Wed, 2024-05-29 at 14:27 +0200, Nuno Sá wrote:
>> On Mon, 2024-05-27 at 20:02 +0300, Dumitru Ceclan via B4 Relay wrote:
>>> From: Dumitru Ceclan <dumitru.ceclan@...log.com>

..

>>> +static int ad7173_validate_voltage_ain_inputs(struct ad7173_state *st,
>>> +					      unsigned int ain[2])
> 
> Pass the pointer and size of it... Also, it should be made 'const'
>

I'm learning here: what is the purpose of passing the size of it?
This is a specific case where the size will always be 2

Also, this will make it awkward in the following patch where I'm using
the assumption of size 2 to check if both inputs have a voltage divider
                                                          ain[(i+1) %2]

>>> +{
>>> +	struct device *dev = &st->sd.spi->dev;
>>> +
>>> +	for (int i = 0; i < 2; i++) {
> 
> Use the size in here... At the very least, ARRAY_SIZE() if you keep it like this.
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ