Commit 17aa26c9 authored by Zou Wei's avatar Zou Wei Committed by Rafael J. Wysocki

PNP: pnpbios: Use list_for_each_entry() instead of list_for_each()

Use list_for_each_entry() instead of list_for_each() where
applicable.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
[ rjw: Subject and changelog rewrite ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 3935787e
...@@ -298,14 +298,12 @@ struct pnp_protocol pnpbios_protocol = { ...@@ -298,14 +298,12 @@ struct pnp_protocol pnpbios_protocol = {
static int __init insert_device(struct pnp_bios_node *node) static int __init insert_device(struct pnp_bios_node *node)
{ {
struct list_head *pos;
struct pnp_dev *dev; struct pnp_dev *dev;
char id[8]; char id[8];
int error; int error;
/* check if the device is already added */ /* check if the device is already added */
list_for_each(pos, &pnpbios_protocol.devices) { list_for_each_entry(dev, &pnpbios_protocol.devices, protocol_list) {
dev = list_entry(pos, struct pnp_dev, protocol_list);
if (dev->number == node->handle) if (dev->number == node->handle)
return -EEXIST; return -EEXIST;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment