[dm-devel] [PATCH] dm-bufio: code cleanup - return NULL, not b

Mikulas Patocka mpatocka at redhat.com
Tue Nov 24 00:11:32 UTC 2015


A small code cleanup - return NULL instead of b (although b is NULL at
this point). This function is not returning pointer to the buffer, it is
returning pointer to bufffer's data, thus it makes no sense to return the
variable b.

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>

Index: linux-4.4-rc2/drivers/md/dm-bufio.c
===================================================================
--- linux-4.4-rc2.orig/drivers/md/dm-bufio.c
+++ linux-4.4-rc2/drivers/md/dm-bufio.c
@@ -1068,7 +1068,7 @@ static void *new_read(struct dm_bufio_cl
 	__flush_write_list(&write_list);
 
 	if (!b)
-		return b;
+		return NULL;
 
 	if (need_submit)
 		submit_io(b, READ, b->block, read_endio);




More information about the dm-devel mailing list