block: remove the nr_sectors variable in generic_make_request_checks
authorChristoph Hellwig <hch@lst.de>
Wed, 1 Jul 2020 08:59:42 +0000 (10:59 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Jul 2020 13:27:24 +0000 (07:27 -0600)
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>
block/blk-core.c

index 37435d0d43356458f31dc7ec4f5a8b7164bae8c7..28f60985dc75cc1b4216b137939cbc56fef2d6c2 100644 (file)
@@ -974,7 +974,6 @@ static noinline_for_stack bool
 generic_make_request_checks(struct bio *bio)
 {
        struct request_queue *q = bio->bi_disk->queue;
-       int nr_sectors = bio_sectors(bio);
        blk_status_t status = BLK_STS_IOERR;
 
        might_sleep();
@@ -1007,7 +1006,7 @@ generic_make_request_checks(struct bio *bio)
        if (op_is_flush(bio->bi_opf) &&
            !test_bit(QUEUE_FLAG_WC, &q->queue_flags)) {
                bio->bi_opf &= ~(REQ_PREFLUSH | REQ_FUA);
-               if (!nr_sectors) {
+               if (!bio_sectors(bio)) {
                        status = BLK_STS_OK;
                        goto end_io;
                }