hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/md/dm-log.c
....@@ -415,8 +415,7 @@
415415 /*
416416 * Work out how many "unsigned long"s we need to hold the bitset.
417417 */
418
- bitset_size = dm_round_up(region_count,
419
- sizeof(*lc->clean_bits) << BYTE_SHIFT);
418
+ bitset_size = dm_round_up(region_count, BITS_PER_LONG);
420419 bitset_size >>= BYTE_SHIFT;
421420
422421 lc->bitset_uint32_count = bitset_size / sizeof(*lc->clean_bits);
....@@ -616,7 +615,7 @@
616615 log_clear_bit(lc, lc->clean_bits, i);
617616
618617 /* clear any old bits -- device has shrunk */
619
- for (i = lc->region_count; i % (sizeof(*lc->clean_bits) << BYTE_SHIFT); i++)
618
+ for (i = lc->region_count; i % BITS_PER_LONG; i++)
620619 log_clear_bit(lc, lc->clean_bits, i);
621620
622621 /* copy clean across to sync */