Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hongbo Li and committed by
Mikulas Patocka
26207c63 35c9f09b

+1 -4
+1 -4
drivers/md/dm-clone-metadata.c
··· 530 530 return r; 531 531 532 532 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)); 537 534 538 535 if (i >= (cmd->nr_regions - 1)) 539 536 break;