Skip to content

Commit

Permalink
dm cache: simplify the return expression of load_mapping()
Browse files Browse the repository at this point in the history
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Zheng Yongjun authored and Mike Snitzer committed Dec 22, 2020
1 parent 52252ad commit b777092
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/md/dm-cache-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}

/*
Expand Down

0 comments on commit b777092

Please sign in to comment.