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

Roland Dreier rdreier at cisco.com
Wed Apr 8 10:21:51 PDT 2009


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

Have you tested this?  It seems like it will print the IP address as a
(possibly byte-reversed) hex value followed by the literal string "I4"
rather than printing it as a formatted IP address.

The problem you seem to be trying to solve is an unused variable warning
when nes debugging is not enabled, but I don't think you can do it by
removing the tmp_addr variable.  The most robust solution would probably
to change the definition of nes_debug() so it appears to gcc to use all
its parameters even when debugging is disabled.  You could look at
drivers/net/mlx4/mlx4.h for an example of one way to do that.

 - R.



More information about the general mailing list