[ofa-general] [PATCH] RDMA/nes: Guard tmp_addr definition with CONFIG_INFINIBAND_NES_DEBUG

Matt Kraai kraai at ftbfs.org
Tue Apr 21 06:09:24 PDT 2009


If CONFIG_INFINIBAND_NES_DEBUG is not defined, nes_debug is defined
away.  Since the invocation of nes_debug in find_listener is the only
use of tmp_addr, GCC complains that the latter is never used:

 drivers/infiniband/hw/nes/nes_cm.c: In function ‘find_listener’:
 drivers/infiniband/hw/nes/nes_cm.c:857: warning: unused variable ‘tmp_addr’

To avoid this, only define tmp_addr if it will be used.  That is, if
CONFIG_INFINIBAND_NES_DEBUG is defined.

Signed-off-by: Matt Kraai <kraai at ftbfs.org>
---
 drivers/infiniband/hw/nes/nes_cm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index dbd9a75..9765027 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -854,7 +854,9 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
 {
 	unsigned long flags;
 	struct nes_cm_listener *listen_node;
+#ifdef CONFIG_INFINIBAND_NES_DEBUG
 	__be32 tmp_addr = cpu_to_be32(dst_addr);
+#endif
 
 	/* walk list and find cm_node associated with this session ID */
 	spin_lock_irqsave(&cm_core->listen_list_lock, flags);
-- 
1.6.2.3




More information about the general mailing list