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 <[email protected]>
---
 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

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to