diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-09-02 15:11:23 +0200 |
---|---|---|
committer | Mikulas Patocka <mpatocka@redhat.com> | 2024-09-02 16:53:53 +0200 |
commit | 26207c6332e83583a74228da9e5278d4fe5d26cf (patch) | |
tree | 4a5d0bf4d4d3c043889639c31ba92392a94c86ce /drivers/md | |
parent | dm integrity: Remove extra unlikely helper (diff) | |
download | linux-26207c6332e83583a74228da9e5278d4fe5d26cf.tar.xz linux-26207c6332e83583a74228da9e5278d4fe5d26cf.zip |
dm: Make use of __assign_bit() API
We have for some time the __assign_bit() API to replace
open coded
if (foo)
__set_bit(n, bar);
else
__clear_bit(n, bar);
Use this API to simplify the code. No functional change
intended.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-clone-metadata.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/md/dm-clone-metadata.c b/drivers/md/dm-clone-metadata.c index 2db84cd2202b..14c5c28d938b 100644 --- a/drivers/md/dm-clone-metadata.c +++ b/drivers/md/dm-clone-metadata.c @@ -530,10 +530,7 @@ static int __load_bitset_in_core(struct dm_clone_metadata *cmd) return r; for (i = 0; ; i++) { - if (dm_bitset_cursor_get_value(&c)) - __set_bit(i, cmd->region_map); - else - __clear_bit(i, cmd->region_map); + __assign_bit(i, cmd->region_map, dm_bitset_cursor_get_value(&c)); if (i >= (cmd->nr_regions - 1)) break; |