[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0ja1rC7yJ2LzVQ5zpBwCuDp5497=_qo9G2hKLHb4amqrA@mail.gmail.com>
Date: Wed, 9 Jun 2021 15:06:02 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Zou Wei <zou_wei@...wei.com>
Cc: Rafael Wysocki <rafael.j.wysocki@...el.com>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] PNP: pnpbios: convert list_for_each to entry variant
On Tue, Jun 8, 2021 at 2:17 PM Zou Wei <zou_wei@...wei.com> wrote:
>
> convert list_for_each() to list_for_each_entry() where
> applicable.
>
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Zou Wei <zou_wei@...wei.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!
Powered by blists - more mailing lists