* [PATCH -next] PNP: pnpbios: convert list_for_each to entry variant
@ 2021-06-08 12:35 Zou Wei
2021-06-09 13:06 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Zou Wei @ 2021-06-08 12:35 UTC (permalink / raw)
To: rafael.j.wysocki; +Cc: linux-acpi, linux-kernel, Zou Wei
convert list_for_each() to list_for_each_entry() where
applicable.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
drivers/pnp/pnpbios/core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 9b760e7..669ef47 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -298,14 +298,12 @@ struct pnp_protocol pnpbios_protocol = {
static int __init insert_device(struct pnp_bios_node *node)
{
- struct list_head *pos;
struct pnp_dev *dev;
char id[8];
int error;
/* check if the device is already added */
- list_for_each(pos, &pnpbios_protocol.devices) {
- dev = list_entry(pos, struct pnp_dev, protocol_list);
+ list_for_each_entry(dev, &pnpbios_protocol.devices, protocol_list) {
if (dev->number == node->handle)
return -EEXIST;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] PNP: pnpbios: convert list_for_each to entry variant
2021-06-08 12:35 [PATCH -next] PNP: pnpbios: convert list_for_each to entry variant Zou Wei
@ 2021-06-09 13:06 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2021-06-09 13:06 UTC (permalink / raw)
To: Zou Wei; +Cc: Rafael Wysocki, ACPI Devel Maling List, Linux Kernel Mailing List
On Tue, Jun 8, 2021 at 2:17 PM Zou Wei <zou_wei@huawei.com> wrote:
>
> convert list_for_each() to list_for_each_entry() where
> applicable.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
> drivers/pnp/pnpbios/core.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
> index 9b760e7..669ef47 100644
> --- a/drivers/pnp/pnpbios/core.c
> +++ b/drivers/pnp/pnpbios/core.c
> @@ -298,14 +298,12 @@ struct pnp_protocol pnpbios_protocol = {
>
> static int __init insert_device(struct pnp_bios_node *node)
> {
> - struct list_head *pos;
> struct pnp_dev *dev;
> char id[8];
> int error;
>
> /* check if the device is already added */
> - list_for_each(pos, &pnpbios_protocol.devices) {
> - dev = list_entry(pos, struct pnp_dev, protocol_list);
> + list_for_each_entry(dev, &pnpbios_protocol.devices, protocol_list) {
> if (dev->number == node->handle)
> return -EEXIST;
> }
> --
Applied as 5.14 material with rewritten subject and changelog, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-09 13:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 12:35 [PATCH -next] PNP: pnpbios: convert list_for_each to entry variant Zou Wei
2021-06-09 13:06 ` Rafael J. Wysocki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.