diff options
author | Roland Dreier <rolandd@cisco.com> | 2009-01-09 16:14:07 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-01-09 16:14:07 -0500 |
commit | 70cb92539cd1b8e1dec935a68fc154ea0db3a177 (patch) | |
tree | 956d3125f32cb8dde879d8c402e99cd9e76698d1 | |
parent | 6a94cb73064c952255336cc57731904174b2c58f (diff) |
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: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/net/mlx4/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 710c79e7a2db..6ef2490d5c3e 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -912,8 +912,8 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) | |||
912 | int i; | 912 | int i; |
913 | 913 | ||
914 | if (msi_x) { | 914 | if (msi_x) { |
915 | nreq = min(dev->caps.num_eqs - dev->caps.reserved_eqs, | 915 | nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, |
916 | num_possible_cpus() + 1); | 916 | num_possible_cpus() + 1); |
917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); | 917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); |
918 | if (!entries) | 918 | if (!entries) |
919 | goto no_msi; | 919 | goto no_msi; |