From: Yuval Shaia <yuval.shaia@oracle.com>
To: yishaih@mellanox.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: [PATCH v2] net/mlx4_core: Use min_t instead of if for consistency
Date: Thu, 11 May 2017 13:36:02 +0300 [thread overview]
Message-ID: <1494498962-16852-1-git-send-email-yuval.shaia@oracle.com> (raw)
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
v0 -> v1:
* s/"min_t("/"min_t(int"
v1 -> v2:
* Use min3 instead of min_t twice
---
drivers/net/ethernet/mellanox/mlx4/main.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 7032054..2afa340 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -2862,12 +2862,9 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
int port = 0;
if (msi_x) {
- int nreq = dev->caps.num_ports * num_online_cpus() + 1;
-
- nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
- nreq);
- if (nreq > MAX_MSIX)
- nreq = MAX_MSIX;
+ int nreq = min3(dev->caps.num_ports * num_online_cpus() + 1,
+ dev->caps.num_eqs - dev->caps.reserved_eqs,
+ MAX_MSIX);
entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);
if (!entries)
--
2.7.4
next reply other threads:[~2017-05-11 10:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-11 10:36 Yuval Shaia [this message]
[not found] ` <1494498962-16852-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-05-11 10:42 ` [PATCH v2] net/mlx4_core: Use min_t instead of if for consistency Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1494498962-16852-1-git-send-email-yuval.shaia@oracle.com \
--to=yuval.shaia@oracle.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yishaih@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox