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: <20241216153341.00001867@huawei.com>
Date: Mon, 16 Dec 2024 15:33:41 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Zijun Hu <zijun_hu@...oud.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki"
	<rafael@...nel.org>, Tejun Heo <tj@...nel.org>, Josef Bacik
	<josef@...icpanda.com>, Jens Axboe <axboe@...nel.dk>, Boris Burkov
	<boris@....io>, Davidlohr Bueso <dave@...olabs.net>, Dave Jiang
	<dave.jiang@...el.com>, Alison Schofield <alison.schofield@...el.com>, Vishal
 Verma <vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, Dan
 Williams <dan.j.williams@...el.com>, <linux-kernel@...r.kernel.org>,
	<cgroups@...r.kernel.org>, <linux-block@...r.kernel.org>,
	<linux-cxl@...r.kernel.org>, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH v3 9/9] driver core: Introduce device_iter_t for device
 iterating APIs

On Thu, 12 Dec 2024 21:38:45 +0800
Zijun Hu <zijun_hu@...oud.com> wrote:

> From: Zijun Hu <quic_zijuhu@...cinc.com>
> 
> There are several for_each APIs which has parameter with type below:
> int (*fn)(struct device *dev, void *data)
> They iterate over various device lists and call @fn() for each device
> with caller provided data @*data, and they usually need to modify @*data.
> 
> Give the type an dedicated typedef with advantages shown below:
> typedef int (*device_iter_t)(struct device *dev, void *data)
> 
> - Shorter API declarations and definitions
> - Prevent further for_each APIs from using bad parameter type
> 
> So introduce device_iter_t and apply it to various existing APIs below:
> bus_for_each_dev()
> (class|driver)_for_each_device()
> device_for_each_child(_reverse|_reverse_from)().
> 
> Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>

I'd normally argue this wasn't worth the effort, but given you tidied
up one inconsistent case in this series, fair enough as far as I'm concerned.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ