Skip to content

Commit

Permalink
PNP: pnpbios: Use list_for_each_entry() instead of list_for_each()
Browse files Browse the repository at this point in the history
Use list_for_each_entry() instead of list_for_each() where
applicable.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
[ rjw: Subject and changelog rewrite ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
SamuelZOU authored and rafaeljw committed Jun 9, 2021
1 parent 3935787 commit 17aa26c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/pnp/pnpbios/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 17aa26c

Please sign in to comment.