Skip to content

Commit fe4ec12

Browse files
Christoph Hellwigaxboe
authored andcommitted
floppy: use block_size
Use the block_size helper instead of open coding it. Also remove the check for a 0 block size, as that can't happen. Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 6e2fa4d commit fe4ec12

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/block/floppy.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4205,23 +4205,18 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive)
42054205
struct bio_vec bio_vec;
42064206
struct page *page;
42074207
struct rb0_cbdata cbdata;
4208-
size_t size;
42094208

42104209
page = alloc_page(GFP_NOIO);
42114210
if (!page) {
42124211
process_fd_request();
42134212
return -ENOMEM;
42144213
}
42154214

4216-
size = bdev->bd_block_size;
4217-
if (!size)
4218-
size = 1024;
4219-
42204215
cbdata.drive = drive;
42214216

42224217
bio_init(&bio, &bio_vec, 1);
42234218
bio_set_dev(&bio, bdev);
4224-
bio_add_page(&bio, page, size, 0);
4219+
bio_add_page(&bio, page, block_size(bdev), 0);
42254220

42264221
bio.bi_iter.bi_sector = 0;
42274222
bio.bi_flags |= (1 << BIO_QUIET);

0 commit comments

Comments
 (0)