diff mbox series

[v1] driver:md:dm-bufio:Remove NULL check of list_entry()

Message ID 20240822021400.1193855-1-liyuesong@vivo.com (mailing list archive)
State Accepted, archived
Delegated to: Mikulas Patocka
Headers show
Series [v1] driver:md:dm-bufio:Remove NULL check of list_entry() | expand

Commit Message

Yuesong Li Aug. 22, 2024, 2:14 a.m. UTC
list_entry() will never return a NULL pointer, thus remove the
check.

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
---
 drivers/md/dm-bufio.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 098bf526136c..d478aafa02c9 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -529,9 +529,6 @@  static struct dm_buffer *list_to_buffer(struct list_head *l)
 {
 	struct lru_entry *le = list_entry(l, struct lru_entry, list);
 
-	if (!le)
-		return NULL;
-
 	return le_to_buffer(le);
 }