[ofa-general] Re: [PATCH] Fix wrong dbg output and gcc warning when INFINIBAND_NES_DEBUG is not set

Roland Dreier rdreier at cisco.com
Tue Apr 7 22:40:10 PDT 2009


 > The debug messaage wrongly prints the address of a local variable. Also when
 > INFINIBAND_NES_DEBUG is not set, gcc emits an unused variable warning. Fix it.

 >  	nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n",
 > -		  &tmp_addr, dst_port);
 > +		  cpu_to_be32(dst_addr), dst_port);

My understanding is that %pI4 wants a pointer (as all %p formats do) --
and every other use of %pI4 in the kernel that I looked as is passing a
pointer to printk.  Have you tested this patch with NES debug on?  I
would expect gcc to warn about passing a non-pointer to a %p format.

 - R.



More information about the general mailing list