Skip to content

Commit e439ab7

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove the nr_sectors variable in generic_make_request_checks
The variable is only used once, so just open code the bio_sector() there. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 833f84e commit e439ab7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎block/blk-core.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,6 @@ static noinline_for_stack bool
974974
generic_make_request_checks(struct bio *bio)
975975
{
976976
struct request_queue *q = bio->bi_disk->queue;
977-
int nr_sectors = bio_sectors(bio);
978977
blk_status_t status = BLK_STS_IOERR;
979978

980979
might_sleep();
@@ -1007,7 +1006,7 @@ generic_make_request_checks(struct bio *bio)
10071006
if (op_is_flush(bio->bi_opf) &&
10081007
!test_bit(QUEUE_FLAG_WC, &q->queue_flags)) {
10091008
bio->bi_opf &= ~(REQ_PREFLUSH | REQ_FUA);
1010-
if (!nr_sectors) {
1009+
if (!bio_sectors(bio)) {
10111010
status = BLK_STS_OK;
10121011
goto end_io;
10131012
}

0 commit comments

Comments
 (0)