liquidio: use list_empty_careful in lio_list_delete_head
authorGeliang Tang <geliangtang@gmail.com>
Sun, 28 Jun 2020 10:14:13 +0000 (18:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jun 2020 04:46:33 +0000 (21:46 -0700)
Use list_empty_careful() instead of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/octeon_network.h

index 50201fc..ebe56bd 100644 (file)
@@ -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;