[PATCH 2/5] brd: don't clear the flag that is not set
- To: <linux-block@vger.kernel.org>, <linux-bcache@vger.kernel.org>
- Cc: <axboe@kernel.dk>, <josef@toxicpanda.com>, <minchan@kernel.org>, <senozhatsky@chromium.org>, <colyli@suse.de>, <kent.overstreet@gmail.com>, <dlemoal@kernel.org>, <kch@nvidia.com>, <johannes.thumshirn@wdc.com>, <bvanassche@acm.org>, <vincent.fu@samsung.com>, <akinobu.mita@gmail.com>, <shinichiro.kawasaki@wdc.com>, <nbd@other.debian.org>
- Subject: [PATCH 2/5] brd: don't clear the flag that is not set
- From: Chaitanya Kulkarni <kch@nvidia.com>
- Date: Mon, 24 Apr 2023 00:30:20 -0700
- Message-id: <[🔎] 20230424073023.38935-3-kch@nvidia.com>
- In-reply-to: <20230424073023.38935-1-kch@nvidia.com>
- References: <20230424073023.38935-1-kch@nvidia.com>
QUEUE_FLAG_ADD_RANDOM is not set in brd_alloc() before we clear it.
There is no point in clearing the flag that is not set.
Remove blk_queue_flag_clear() for QUEUE_FLAG_ADD_RANDOM.
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
drivers/block/brd.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 34177f1bd97d..bcad9b926b0c 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -404,7 +404,6 @@ static int brd_alloc(int i)
/* Tell the block layer that this is not a rotational device */
blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
blk_queue_flag_set(QUEUE_FLAG_SYNCHRONOUS, disk->queue);
- blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, disk->queue);
blk_queue_flag_set(QUEUE_FLAG_NOWAIT, disk->queue);
err = add_disk(disk);
if (err)
--
2.40.0
Reply to: