[PATCH] parport: use list_first_entry
From: Geliang Tang
Date: Wed Nov 25 2015 - 07:37:51 EST
To make the intention clearer, use list_first_entry instead of list_entry.
Signed-off-by: Geliang Tang <geliangtang@xxxxxxx>
---
drivers/parport/parport_pc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 78530d1..3bbe641 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -3340,8 +3340,8 @@ static void __exit parport_pc_exit(void)
struct parport_pc_private *priv;
struct parport *port;
struct device *dev;
- priv = list_entry(ports_list.next,
- struct parport_pc_private, list);
+ priv = list_first_entry(&ports_list,
+ struct parport_pc_private, list);
port = priv->port;
dev = port->dev;
parport_pc_unregister_port(port);
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/