Re: [PATCH net-next] liquidio: use list_empty_careful in lio_list_delete_head

2020-06-29 Thread David Miller
From: Geliang Tang 
Date: Sun, 28 Jun 2020 18:14:13 +0800

> Use list_empty_careful() instead of open-coding.
> 
> Signed-off-by: Geliang Tang 

Also applied, thank you.


[PATCH net-next] liquidio: use list_empty_careful in lio_list_delete_head

2020-06-28 Thread Geliang Tang
Use list_empty_careful() instead of open-coding.

Signed-off-by: Geliang Tang 
---
 drivers/net/ethernet/cavium/liquidio/octeon_network.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_network.h 
b/drivers/net/ethernet/cavium/liquidio/octeon_network.h
index 50201fc86dcf..ebe56bd8849b 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_network.h
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_network.h
@@ -612,7 +612,7 @@ static inline struct list_head *lio_list_delete_head(struct 
list_head *root)
 {
struct list_head *node;
 
-   if (root->prev == root && root->next == root)
+   if (list_empty_careful(root))
node = NULL;
else
node = root->next;
-- 
2.17.1