summaryrefslogtreecommitdiff
path: root/drivers/pnp/pnpbios/core.c
diff options
context:
space:
mode:
authorZou Wei <zou_wei@huawei.com>2021-06-08 15:35:32 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-06-09 16:04:30 +0300
commit17aa26c96fb240de92db90ec1bfd616f28b6dc16 (patch)
tree0acb2001d7bfa6e07e39fa5dea261fc016d2b504 /drivers/pnp/pnpbios/core.c
parent3935787ebd5f4117d39c6fda6d73ecfdb747349f (diff)
downloadlinux-17aa26c96fb240de92db90ec1bfd616f28b6dc16.tar.xz
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: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pnp/pnpbios/core.c')
-rw-r--r--drivers/pnp/pnpbios/core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 9b760e73ee8f..669ef4700c1a 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;
}