Skip to content

Commit 26207c6

Browse files
Hongbo LiMikulas Patocka
authored andcommitted
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 <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 35c9f09 commit 26207c6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/md/dm-clone-metadata.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,7 @@ static int __load_bitset_in_core(struct dm_clone_metadata *cmd)
530530
return r;
531531

532532
for (i = 0; ; i++) {
533-
if (dm_bitset_cursor_get_value(&c))
534-
__set_bit(i, cmd->region_map);
535-
else
536-
__clear_bit(i, cmd->region_map);
533+
__assign_bit(i, cmd->region_map, dm_bitset_cursor_get_value(&c));
537534

538535
if (i >= (cmd->nr_regions - 1))
539536
break;

0 commit comments

Comments
 (0)