From: Geliang Tang Date: Sun, 28 Jun 2020 10:14:13 +0000 (+0800) Subject: liquidio: use list_empty_careful in lio_list_delete_head X-Git-Tag: microblaze-v5.10~134^2~397 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=b8483ecaf72ee9059dcca5de969781028a550f89;p=linux-2.6-microblaze.git liquidio: use list_empty_careful in lio_list_delete_head Use list_empty_careful() instead of open-coding. Signed-off-by: Geliang Tang Signed-off-by: David S. Miller --- 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;