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: <CAJ9a7VgtK1AtjhM+i41nyDnza27gigg2JioC2xBmWkPeLBS0zQ@mail.gmail.com>
Date: Mon, 19 Aug 2024 11:34:51 +0100
From: Mike Leach <mike.leach@...aro.org>
To: Javier Carrasco <javier.carrasco.cruz@...il.com>
Cc: Suzuki K Poulose <suzuki.poulose@....com>, 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>, 
	Jonathan Cameron <jic23@...nel.org>, 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 v2 1/3] coresight: cti: use device_* to iterate over
 device child nodes

On Thu, 8 Aug 2024 at 16:12, Javier Carrasco
<javier.carrasco.cruz@...il.com> 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>
> ---
>  drivers/hwtracing/coresight/coresight-cti-platform.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
> index ccef04f27f12..d0ae10bf6128 100644
> --- a/drivers/hwtracing/coresight/coresight-cti-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
> @@ -416,20 +416,16 @@ static int cti_plat_create_impdef_connections(struct device *dev,
>                                               struct cti_drvdata *drvdata)
>  {
>         int rc = 0;
> -       struct fwnode_handle *fwnode = dev_fwnode(dev);
> -       struct fwnode_handle *child = NULL;
>
> -       if (IS_ERR_OR_NULL(fwnode))
> +       if (IS_ERR_OR_NULL(dev_fwnode(dev)))
>                 return -EINVAL;
>
> -       fwnode_for_each_child_node(fwnode, child) {
> +       device_for_each_child_node_scoped(dev, child) {
>                 if (cti_plat_node_name_eq(child, CTI_DT_CONNS))
> -                       rc = cti_plat_create_connection(dev, drvdata,
> -                                                       child);
> +                       rc = cti_plat_create_connection(dev, drvdata, child);
>                 if (rc != 0)
>                         break;
>         }
> -       fwnode_handle_put(child);
>
>         return rc;
>  }
>
> --
> 2.43.0
>

Reviewed-by: Mike Leach <mike.leach@...aro.org>


-- 
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ