lkml.org 
[lkml]   [2015]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] parport: use list_first_entry
Date
To make the intention clearer, use list_first_entry instead of list_entry.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
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



\
 
 \ /
  Last update: 2015-11-25 14:01    [W:0.042 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site