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]
Message-ID: <014f2380e9261a1449214907a149f11267acdd11.camel@gmail.com>
Date: Fri, 17 Oct 2025 15:14:52 +0100
From: Nuno Sá <noname.nuno@...il.com>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>, linux-iio@...r.kernel.org,
 	devicetree@...r.kernel.org, linux-doc@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Cc: jic23@...nel.org, michael.hennerich@...log.com, nuno.sa@...log.com, 
	eblanc@...libre.com, dlechner@...libre.com, andy@...nel.org,
 robh@...nel.org, 	krzk+dt@...nel.org, conor+dt@...nel.org, corbet@....net, 
	marcelo.schmitt1@...il.com, Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH v5 4/7] iio: adc: ad4030: Use BIT macro to improve code
 readability

On Tue, 2025-10-14 at 19:21 -0300, Marcelo Schmitt wrote:
> Use BIT macro to make the list of average modes more readable.
> 
> Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Link:
> https://lore.kernel.org/linux-iio/CAHp75Vfu-C3Hd0ZXTj4rxEgRe_O84cfo6jiRCPFxZJnYrvROWQ@mail.gmail.com/
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@...log.com>
> ---

I don't find the link particular useful in here. Seems redundant with the
Suggested-by tag. Anyways:

Reviewed-by: Nuno Sá <nuno.sa@...log.com>

>  drivers/iio/adc/ad4030.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad4030.c b/drivers/iio/adc/ad4030.c
> index 4393160c7c77..b2847fd90271 100644
> --- a/drivers/iio/adc/ad4030.c
> +++ b/drivers/iio/adc/ad4030.c
> @@ -233,9 +233,11 @@ struct ad4030_state {
>  }
>  
>  static const int ad4030_average_modes[] = {
> -	1, 2, 4, 8, 16, 32, 64, 128,
> -	256, 512, 1024, 2048, 4096, 8192, 16384, 32768,
> -	65536,
> +	BIT(0),					/* No
> averaging/oversampling */
> +	BIT(1), BIT(2), BIT(3), BIT(4),		/* 2 to 16 */
> +	BIT(5), BIT(6), BIT(7), BIT(8),		/* 32 to 256 */
> +	BIT(9), BIT(10), BIT(11), BIT(12),	/* 512 to 4096 */
> +	BIT(13), BIT(14), BIT(15), BIT(16),	/* 8192 to 65536 */
>  };
>  
>  static int ad4030_enter_config_mode(struct ad4030_state *st)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ