Commit 70cb9253 authored by Roland Dreier's avatar Roland Dreier

mlx4_core: Fix warning from min()

Recent cpumask changes changed num_possible_cpus() from returning an int
to returning an unsigned int.  This means that doing

    min(num_possible_cpus(), <int expression>)

now produces a warning like

    drivers/net/mlx4/main.c: In function 'mlx4_enable_msi_x':
    drivers/net/mlx4/main.c:915: warning: comparison of distinct pointer types lacks a cast

Fix this by using min_t(int, ...).
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 6a94cb73
......@@ -912,7 +912,7 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
int i;
if (msi_x) {
nreq = min(dev->caps.num_eqs - dev->caps.reserved_eqs,
nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
num_possible_cpus() + 1);
entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);
if (!entries)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment