]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dm cache: simplify the return expression of load_mapping()
authorZheng Yongjun <zhengyongjun3@huawei.com>
Thu, 10 Dec 2020 14:01:03 +0000 (22:01 +0800)
committerMike Snitzer <snitzer@redhat.com>
Tue, 22 Dec 2020 14:54:48 +0000 (09:54 -0500)
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-target.c

index 4bc453f5bbaa6d3314db7a49eb7f7661548b7839..541c45027cc858c45703642f78df87fb322c7da0 100644 (file)
@@ -2840,7 +2840,6 @@ static void cache_postsuspend(struct dm_target *ti)
 static int load_mapping(void *context, dm_oblock_t oblock, dm_cblock_t cblock,
                        bool dirty, uint32_t hint, bool hint_valid)
 {
-       int r;
        struct cache *cache = context;
 
        if (dirty) {
@@ -2849,11 +2848,7 @@ static int load_mapping(void *context, dm_oblock_t oblock, dm_cblock_t cblock,
        } else
                clear_bit(from_cblock(cblock), cache->dirty_bitset);
 
-       r = policy_load_mapping(cache->policy, oblock, cblock, dirty, hint, hint_valid);
-       if (r)
-               return r;
-
-       return 0;
+       return policy_load_mapping(cache->policy, oblock, cblock, dirty, hint, hint_valid);
 }
 
 /*