Thread (29 messages) 29 messages, 4 authors, 2020-07-23

Re: [PATCH 06/10] block: ms_block: use blk_is_valid_logical_block_size

From: Damien Le Moal <hidden>
Date: 2020-07-21 11:17:08
Also in: linux-block, linux-mmc, linux-scsi, lkml

On 2020/07/21 19:54, Maxim Levitsky wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Maxim Levitsky <redacted>
---
 drivers/memstick/core/ms_block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c
index d9ee8e3dc72da..e4df03e10fb46 100644
--- a/drivers/memstick/core/ms_block.c
+++ b/drivers/memstick/core/ms_block.c
@@ -1727,7 +1727,7 @@ static int msb_init_card(struct memstick_dev *card)
 	msb->pages_in_block = boot_block->attr.block_size * 2;
 	msb->block_size = msb->page_size * msb->pages_in_block;
 
-	if (msb->page_size > PAGE_SIZE) {
+	if (!(blk_is_valid_logical_block_size(msb->page_size))) {
 		/* this isn't supported by linux at all, anyway*/
 		dbg("device page %d size isn't supported", msb->page_size);
 		return -EINVAL;
Looks good to me.

Reviewed-by: Damien Le Moal <redacted>

-- 
Damien Le Moal
Western Digital Research
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help