[openib-general] Re: [openib-commits] r2063 - in gen2/trunk/src/linux-kernel/infiniband: core include

Tom Duffy tduffy at sun.com
Tue Mar 29 12:25:44 PST 2005


On Mon, 2005-03-28 at 18:06 -0800, libor at openib.org wrote:
> Initial commit for kernel portion of the userspace CM interface.

I am getting a few compile warnings when compiling x86_64:

/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c: In function ‘ib_ucm_event_req_get’:
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c:188: warning: cast from pointer to integer of different size
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c: In function ‘ib_ucm_event_sidr_req_get’:
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c:251: warning: cast from pointer to integer of different size
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c: In function ‘ib_ucm_event_handler’:
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c:386: warning: cast from pointer to integer of different size
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c:389: warning: cast from pointer to integer of different size
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c:392: warning: cast from pointer to integer of different size
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c: In function ‘ib_ucm_write’:
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c:1243: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘size_t’
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/ucm.c:1243: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘size_t’

It seems that since context is a void*, if you are using this as an id,
and id is only 32bits, you may lose information on a 64-bit archs.

This simple patch will fix the last warning:

Signed-off-by: Tom Duffy <tduffy at sun.com>

Index: drivers/infiniband/core/ucm.c
===================================================================
--- drivers/infiniband/core/ucm.c	(revision 2068)
+++ drivers/infiniband/core/ucm.c	(working copy)
@@ -1240,7 +1240,7 @@ static ssize_t ib_ucm_write(struct file 
 		return -EFAULT;
 
 	printk(KERN_ERR "UCM: Write. cmd <%d> in <%d> out <%d> len <%d>\n",
-	       hdr.cmd, hdr.in, hdr.out, len);
+	       hdr.cmd, hdr.in, hdr.out, (int)len);
 
 	if (hdr.cmd < 0 || hdr.cmd >= ARRAY_SIZE(ucm_cmd_table))
 		return -EINVAL;




More information about the general mailing list