diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2022-06-25 14:56:05 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2022-07-12 12:29:36 +0200 |
commit | aabf199c4eff56e8b36a4c2807c041d93b20c1e1 (patch) | |
tree | f5af2e6ec8253c6f2b41cbe13eb44e909080d063 /drivers/memstick | |
parent | 54eb7a55be6779c4d0c25eaf5056498a28595049 (diff) | |
download | linux-stable-aabf199c4eff56e8b36a4c2807c041d93b20c1e1.tar.gz linux-stable-aabf199c4eff56e8b36a4c2807c041d93b20c1e1.tar.bz2 linux-stable-aabf199c4eff56e8b36a4c2807c041d93b20c1e1.zip |
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>
Diffstat (limited to 'drivers/memstick')
-rw-r--r-- | drivers/memstick/core/ms_block.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index f8fdf88fb240..c05edfc1c841 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -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; |