Skip to content

Commit aabf199

Browse files
tititiou36Ulf Hansson
authored andcommitted
memstick/ms_block: Use the bitmap API when applicable
Use bitmap_equal() instead of hand writing it. It improves semantic and avoids some explicit computation to convert a number of bits to a number of bytes. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/b216df8798f765ab14bce65739c220643320f376.1656155715.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 54eb7a5 commit aabf199

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/memstick/core/ms_block.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,8 +2245,8 @@ static int msb_resume(struct memstick_dev *card)
22452245
goto out;
22462246

22472247
if (msb->block_count != new_msb->block_count ||
2248-
memcmp(msb->used_blocks_bitmap, new_msb->used_blocks_bitmap,
2249-
msb->block_count / 8))
2248+
!bitmap_equal(msb->used_blocks_bitmap, new_msb->used_blocks_bitmap,
2249+
msb->block_count))
22502250
goto out;
22512251

22522252
card_dead = false;

0 commit comments

Comments
 (0)