[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250315110800107off32dfmFxS4oTSqBr20T@zte.com.cn>
Date: Sat, 15 Mar 2025 11:08:00 +0800 (CST)
From: <feng.wei8@....com.cn>
To: <james.smart@...adcom.com>
Cc: <kbusch@...nel.org>, <axboe@...nel.dk>, <hch@....de>, <sagi@...mberg.me>,
<linux-nvme@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] nvme-fc: Replace nested min() with single min3()
From: FengWei <feng.wei8@....com.cn>
Use min3() macro instead of nesting min() to simplify the return
statement.
Signed-off-by: FengWei <feng.wei8@....com.cn>
---
drivers/nvme/host/fc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index b9929a5a7f4e..fbb11962894f 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2858,7 +2858,7 @@ nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl)
unsigned int nr_io_queues;
int ret;
- nr_io_queues = min(min(opts->nr_io_queues, num_online_cpus()),
+ nr_io_queues = min3(opts->nr_io_queues, num_online_cpus(),
ctrl->lport->ops->max_hw_queues);
ret = nvme_set_queue_count(&ctrl->ctrl, &nr_io_queues);
if (ret) {
--
2.25.1
Powered by blists - more mailing lists