dm bufio: Remove NULL check of list_entry()
authorYuesong Li <liyuesong@vivo.com>
Thu, 22 Aug 2024 02:14:00 +0000 (10:14 +0800)
committerMikulas Patocka <mpatocka@redhat.com>
Thu, 22 Aug 2024 16:32:55 +0000 (18:32 +0200)
list_entry() will never return a NULL pointer, thus remove the
check.

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-bufio.c

index 098bf52..d478aaf 100644 (file)
@@ -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);
 }