[ofa-general] [RFC PATCH 07/14] RFC IB/ipath: Fix sparse warning about pointer signedness

Roland Dreier rolandd at cisco.com
Fri Feb 29 20:26:03 PST 2008


ipath_count_units() wants its third parameter to be a u32 *, so change
the declaration of maxofallports in find_best_unit() to be a u32 instead
of a signed int.  This fixes

    drivers/infiniband/hw/ipath/ipath_file_ops.c:1654:47: warning: incorrect type in argument 3 (different signedness)
    drivers/infiniband/hw/ipath/ipath_file_ops.c:1654:47:    expected unsigned int [usertype] *maxportsp
    drivers/infiniband/hw/ipath/ipath_file_ops.c:1654:47:    got int *<noident>

Signed-off-by: Roland Dreier <rolandd at cisco.com>
---
 drivers/infiniband/hw/ipath/ipath_file_ops.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 7e025c8..338733e 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -1648,7 +1648,8 @@ static int find_best_unit(struct file *fp,
 			  const struct ipath_user_info *uinfo)
 {
 	int ret = 0, i, prefunit = -1, devmax;
-	int maxofallports, npresent, nup;
+	int npresent, nup;
+	u32 maxofallports;
 	int ndev;
 
 	devmax = ipath_count_units(&npresent, &nup, &maxofallports);
-- 
1.5.4.2





More information about the general mailing list