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: <20240803121752.4d9693bc@jic23-huawei>
Date: Sat, 3 Aug 2024 12:17:52 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Nuno Sá <noname.nuno@...il.com>
Cc: Javier Carrasco <javier.carrasco.cruz@...il.com>, Suzuki K Poulose
 <suzuki.poulose@....com>, Mike Leach <mike.leach@...aro.org>, James Clark
 <james.clark@...aro.org>, Alexander Shishkin
 <alexander.shishkin@...ux.intel.com>, Michael Hennerich
 <Michael.Hennerich@...log.com>, Lars-Peter Clausen <lars@...afoo.de>, Anand
 Ashok Dumbre <anand.ashok.dumbre@...inx.com>, Michal Simek
 <michal.simek@....com>, Sakari Ailus <sakari.ailus@...ux.intel.com>, Pavel
 Machek <pavel@....cz>, Lee Jones <lee@...nel.org>,
 coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
 linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
 linux-leds@...r.kernel.org
Subject: Re: [PATCH 2/4] iio: adc: ad7768-1: use device_* to iterate over
 device child nodes

On Thu, 01 Aug 2024 09:31:16 +0200
Nuno Sá <noname.nuno@...il.com> wrote:

> On Thu, 2024-08-01 at 08:13 +0200, Javier Carrasco wrote:
> > Drop the manual access to the fwnode of the device to iterate over its
> > child nodes. `device_for_each_child_node` macro provides direct access
> > to the child nodes, and given that they are only required within the
> > loop, the scoped variant of the macro can be used.
> > 
> > Use the `device_for_each_child_node_scoped` macro to iterate over the
> > direct child nodes of the device.
> > 
> > Signed-off-by: Javier Carrasco <javier.carrasco.cruz@...il.com>
> > ---  
> 
> Reviewed-by: Nuno Sa <nuno.sa@...log.com>
Applied
> 
> >  drivers/iio/adc/ad7768-1.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c
> > index 70a25949142c..721672fe84ab 100644
> > --- a/drivers/iio/adc/ad7768-1.c
> > +++ b/drivers/iio/adc/ad7768-1.c
> > @@ -544,13 +544,10 @@ static int ad7768_set_channel_label(struct iio_dev
> > *indio_dev,
> >  {
> >  	struct ad7768_state *st = iio_priv(indio_dev);
> >  	struct device *device = indio_dev->dev.parent;
> > -	struct fwnode_handle *fwnode;
> > -	struct fwnode_handle *child;
> >  	const char *label;
> >  	int crt_ch = 0;
> >  
> > -	fwnode = dev_fwnode(device);
> > -	fwnode_for_each_child_node(fwnode, child) {
> > +	device_for_each_child_node_scoped(device, child) {
> >  		if (fwnode_property_read_u32(child, "reg", &crt_ch))
> >  			continue;
> >  
> >   
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ