[RFC PATCH 11/21] floppy: use lib tagset init helper
Chaitanya Kulkarni
kch at nvidia.com
Tue Oct 4 20:22:47 PDT 2022
Use the block layer helper to initialize the common fields of tag_set
such as blk_mq_ops, number of h/w queues, queue depth, command size,
numa_node, timeout, BLK_MQ_F_XXX flags, driver data. This initialization
is spread all over the block drivers. This avoids the code repetation of
the inialization code of the tag set in current block drivers and any
future ones.
Signed-off-by: Chaitanya Kulkarni <kch at nvidia.com>
---
drivers/block/floppy.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index ccad3d7b3ddd..3a3260e6ac5c 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4582,12 +4582,9 @@ static int __init do_floppy_init(void)
for (drive = 0; drive < N_DRIVE; drive++) {
memset(&tag_sets[drive], 0, sizeof(tag_sets[drive]));
- tag_sets[drive].ops = &floppy_mq_ops;
- tag_sets[drive].nr_hw_queues = 1;
+ blk_mq_init_tag_set(&tag_sets[drive], &floppy_mq_ops, 1, 2,
+ 0, NUMA_NO_NODE, 0, BLK_MQ_F_SHOULD_MERGE, NULL);
tag_sets[drive].nr_maps = 1;
- tag_sets[drive].queue_depth = 2;
- tag_sets[drive].numa_node = NUMA_NO_NODE;
- tag_sets[drive].flags = BLK_MQ_F_SHOULD_MERGE;
err = blk_mq_alloc_tag_set(&tag_sets[drive]);
if (err)
goto out_put_disk;
--
2.29.0
More information about the Linux-nvme
mailing list