dm cache metadata: remove unnecessary variable in __dump_mapping
authorGuo Zhengkui <guozhengkui@vivo.com>
Wed, 4 May 2022 16:28:26 +0000 (00:28 +0800)
committerMike Snitzer <snitzer@kernel.org>
Mon, 9 May 2022 19:40:10 +0000 (15:40 -0400)
Fix the following coccicheck warning:

drivers/md/dm-cache-metadata.c:1512:5-6: Unneeded variable: "r".
Return "0" on line 1520.

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-cache-metadata.c

index 2874f22..ab13b73 100644 (file)
@@ -1509,7 +1509,6 @@ int dm_cache_load_mappings(struct dm_cache_metadata *cmd,
 
 static int __dump_mapping(void *context, uint64_t cblock, void *leaf)
 {
-       int r = 0;
        __le64 value;
        dm_oblock_t oblock;
        unsigned flags;
@@ -1517,7 +1516,7 @@ static int __dump_mapping(void *context, uint64_t cblock, void *leaf)
        memcpy(&value, leaf, sizeof(value));
        unpack_value(value, &oblock, &flags);
 
-       return r;
+       return 0;
 }
 
 static int __dump_mappings(struct dm_cache_metadata *cmd)