[ofa-general] Re: sparse output

Roland Dreier rdreier at cisco.com
Mon Aug 13 20:33:24 PDT 2007


I added at least this to my 2.6.24 tree:

commit d76781d993412d0d1f05894fe0749622b37b1329
Author: Roland Dreier <rolandd at cisco.com>
Date:   Mon Aug 13 20:32:31 2007 -0700

    IB: find_first_zero_bit() takes unsigned pointer
    
    Fix sparse warning
    
        drivers/infiniband/core/device.c:142:6: warning: incorrect type in argument 1 (different signedness)
        drivers/infiniband/core/device.c:142:6:    expected unsigned long const *addr
        drivers/infiniband/core/device.c:142:6:    got long *[assigned] inuse
    
    by making the local variable inuse unsigned.  Does not affect generated
    code at all.
    
    Signed-off-by: Roland Dreier <rolandd at cisco.com>

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 3ada17c..1a6233f 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -120,12 +120,12 @@ static struct ib_device *__ib_device_get_by_name(const char *name)
 
 static int alloc_name(char *name)
 {
-	long *inuse;
+	unsigned long *inuse;
 	char buf[IB_DEVICE_NAME_MAX];
 	struct ib_device *device;
 	int i;
 
-	inuse = (long *) get_zeroed_page(GFP_KERNEL);
+	inuse = (unsigned long *) get_zeroed_page(GFP_KERNEL);
 	if (!inuse)
 		return -ENOMEM;
 



More information about the general mailing list