Skip to content

Commit

Permalink
mlx4_core: Fix warning from min()
Browse files Browse the repository at this point in the history
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: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Jan 9, 2009
1 parent 6a94cb7 commit 70cb925
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,8 @@ 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,
num_possible_cpus() + 1);
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)
goto no_msi;
Expand Down

0 comments on commit 70cb925

Please sign in to comment.