Skip to content

Commit

Permalink
memstick/ms_block: Use the bitmap API when applicable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/b216df8798f765ab14bce65739c220643320f376.1656155715.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
tititiou36 authored and storulf committed Jul 12, 2022
1 parent 54eb7a5 commit aabf199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/memstick/core/ms_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -2245,8 +2245,8 @@ static int msb_resume(struct memstick_dev *card)
goto out;

if (msb->block_count != new_msb->block_count ||
memcmp(msb->used_blocks_bitmap, new_msb->used_blocks_bitmap,
msb->block_count / 8))
!bitmap_equal(msb->used_blocks_bitmap, new_msb->used_blocks_bitmap,
msb->block_count))
goto out;

card_dead = false;
Expand Down

0 comments on commit aabf199

Please sign in to comment.