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: <aO_PSisFmsYb84r0@smile.fi.intel.com>
Date: Wed, 15 Oct 2025 19:43:54 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: Jonathan Cameron <jic23@...nel.org>, dlechner@...libre.com,
	nuno.sa@...log.com, andy@...nel.org, robh@...nel.org,
	conor+dt@...nel.org, krzk+dt@...nel.org, linux-iio@...r.kernel.org,
	s32@....com, linux-kernel@...r.kernel.org,
	devicetree@...r.kernel.org, chester62515@...il.com,
	mbrugger@...e.com, ghennadi.procopciuc@....nxp.com
Subject: Re: [PATCH v4 2/2] iio: adc: Add the NXP SAR ADC support for the
 s32g2/3 platforms

On Wed, Oct 15, 2025 at 09:17:40AM +0200, Daniel Lezcano wrote:
> On 9/20/25 11:27, Jonathan Cameron wrote:

[ ... ]

>         ceocfr = readl(NXP_SAR_ADC_CEOCFR0(info->regs));
> -       if (!(ceocfr & NXP_SAR_ADC_EOC_CH(chan)))
> +
> +       /* FIELD_GET() can not be used here because EOC_CH is not constant
> */
> +       if (!(NXP_SAR_ADC_EOC_CH(chan) & ceocfr))
>                 return -EIO;

Make field_get() public in bitfield.h and use it. We have a handful copies
already which deserves someone actually does that for all.

>         cdr = readl(NXP_SAR_ADC_CDR(info->regs, chan));
> -       if (!(cdr & NXP_SAR_ADC_CDR_VALID))
> +       if (!(FIELD_GET(NXP_SAR_ADC_CDR_VALID, cdr)))
>                 return -EIO;
> 
> -       return cdr & NXP_SAR_ADC_CDR_CDATA_MASK;
> +       return FIELD_GET(NXP_SAR_ADC_CDR_CDATA_MASK, cdr);

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ