浏览代码

[IPV4]: Fix inetpeer gcc-4.2 warnings

  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>
Patrick McHardy 18 年之前
父节点
当前提交
fc7b93800b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      net/ipv4/inetpeer.c

+ 2 - 2
net/ipv4/inetpeer.c

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