Skip to content

Commit

Permalink
[IPV4]: Fix inetpeer gcc-4.2 warnings
Browse files Browse the repository at this point in the history
  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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kaber authored and davem330 committed Jul 21, 2007
1 parent c2e6805 commit fc7b938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/inetpeer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
} \
Expand All @@ -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; \
} \
Expand Down

0 comments on commit fc7b938

Please sign in to comment.