lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250315111145865z64IAaowsh-ET7-jNitd9@zte.com.cn>
Date: Sat, 15 Mar 2025 11:11:45 +0800 (CST)
From: <feng.wei8@....com.cn>
To: <kbusch@...nel.org>
Cc: <james.smart@...adcom.com>, <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()

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..b5bd58639154 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2912,7 +2912,7 @@ nvme_fc_recreate_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
<div class="zcontentRow"><p>From: FengWei &lt;feng.wei8@....com.cn&gt;<br></p><p><br></p><p>Use min3() macro instead of nesting min()</p><p><br></p><p>Signed-off-by: FengWei &lt;feng.wei8@....com.cn&gt;</p><p>---</p><p>&nbsp;drivers/nvme/host/fc.c | 2 +-</p><p>&nbsp;1 file changed, 1 insertion(+), 1 deletion(-)</p><p><br></p><p>diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c</p><p>index b9929a5a7f4e..b5bd58639154 100644</p><p>--- a/drivers/nvme/host/fc.c</p><p>+++ b/drivers/nvme/host/fc.c</p><p>@@ -2912,7 +2912,7 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)</p><p>&nbsp;<span style="white-space:pre">	</span>unsigned int nr_io_queues;</p><p>&nbsp;<span style="white-space:pre">	</span>int ret;</p><p>&nbsp;</p><p>-<span style="white-space:pre">	</span>nr_io_queues = min(min(opts-&gt;nr_io_queues, num_online_cpus()),</p><p>+<span style="white-space:pre">	</span>nr_io_queues = min3(opts-&gt;nr_io_queues, num_online_cpus(),</p><p>&nbsp;<span style="white-space:pre">				</span>ctrl-&gt;lport-&gt;ops-&gt;max_hw_queues);</p><p>&nbsp;<span style="white-space:pre">	</span>ret = nvme_set_queue_count(&amp;ctrl-&gt;ctrl, &amp;nr_io_queues);</p><p>&nbsp;<span style="white-space:pre">	</span>if (ret) {</p><p>--&nbsp;</p><p>2.25.1</p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p></div>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ