[IPV4]: Fix inetpeer gcc-4.2 warnings
authorPatrick McHardy <kaber@trash.net>
Sat, 21 Jul 2007 02:39:17 +0000 (19:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Jul 2007 02:39:17 +0000 (19:39 -0700)
  CC      net/ipv4/inetpeer.o
net/ipv4/inetpeer.c: In function 'unlink_from_pool':
net/ipv4/inetpeer.c:297: warning: the address of 'stack' will always evaluate as 'true'
net/ipv4/inetpeer.c:297: warning: the address of 'stack' will always evaluate as 'true'
net/ipv4/inetpeer.c: In function 'inet_getpeer':
net/ipv4/inetpeer.c:409: warning: the address of 'stack' will always evaluate as 'true'
net/ipv4/inetpeer.c:409: warning: the address of 'stack' will always evaluate as 'true'

"Fix" by checking for != NULL.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inetpeer.c

index 6cbce96a54cef2cc5722f9290181ce1b090f78a0..771031dfbd0f875c807a0f82fd96a870d770c2e7 100644 (file)
@@ -158,7 +158,7 @@ static void unlink_from_unused(struct inet_peer *p)
 #define lookup(_daddr,_stack)                                  \
 ({                                                             \
        struct inet_peer *u, **v;                               \
-       if (_stack) {                                           \
+       if (_stack != NULL) {                                   \
                stackptr = _stack;                              \
                *stackptr++ = &peer_root;                       \
        }                                                       \
@@ -169,7 +169,7 @@ static void unlink_from_unused(struct inet_peer *p)
                        v = &u->avl_left;                       \
                else                                            \
                        v = &u->avl_right;                      \
-               if (_stack)                                     \
+               if (_stack != NULL)                             \
                        *stackptr++ = v;                        \
                u = *v;                                         \
        }                                                       \