]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dm bufio: return NULL to improve code clarity
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 24 Nov 2015 00:11:32 +0000 (19:11 -0500)
committerMike Snitzer <snitzer@redhat.com>
Thu, 10 Dec 2015 15:38:57 +0000 (10:38 -0500)
A small code cleanup in new_read() - return NULL instead of b (although
b is NULL at this point).  This function is not returning pointer to the
buffer, it is returning a pointer to the bufffer's data, thus it makes
no sense to return the variable b.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-bufio.c

index 2dd33085b331da5bee79392dcf30f7e2c734f70b..7734298bff3c9f8e0acb8e60846799e63dfa99d9 100644 (file)
@@ -1068,7 +1068,7 @@ static void *new_read(struct dm_bufio_client *c, sector_t block,
        __flush_write_list(&write_list);
 
        if (!b)
-               return b;
+               return NULL;
 
        if (need_submit)
                submit_io(b, READ, b->block, read_endio);