Skip to content

Commit 17aa26c

Browse files
SamuelZOUrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Zou Wei <[email protected]> [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3935787 commit 17aa26c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/pnp/pnpbios/core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,12 @@ struct pnp_protocol pnpbios_protocol = {
298298

299299
static int __init insert_device(struct pnp_bios_node *node)
300300
{
301-
struct list_head *pos;
302301
struct pnp_dev *dev;
303302
char id[8];
304303
int error;
305304

306305
/* check if the device is already added */
307-
list_for_each(pos, &pnpbios_protocol.devices) {
308-
dev = list_entry(pos, struct pnp_dev, protocol_list);
306+
list_for_each_entry(dev, &pnpbios_protocol.devices, protocol_list) {
309307
if (dev->number == node->handle)
310308
return -EEXIST;
311309
}

0 commit comments

Comments
 (0)