From: Chuck L. <chu...@or...> - 2012-08-30 21:04:19
|
include/net/netns/generic.h: In function ‘net_generic’: include/net/netns/generic.h:40:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Seen with gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2). Ensure everywhere that stores or compares a net ID uses a signed int. Signed-off-by: Chuck Lever <chu...@or...> --- include/net/netns/generic.h | 2 +- net/core/net_namespace.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index 0931618..d508392 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h @@ -25,7 +25,7 @@ */ struct net_generic { - unsigned int len; + int len; struct rcu_head rcu; void *ptr[0]; diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 42f1e1c..f264152 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -34,7 +34,7 @@ EXPORT_SYMBOL(init_net); #define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */ -static unsigned int max_gen_ptrs = INITIAL_NET_GEN_PTRS; +static int max_gen_ptrs = INITIAL_NET_GEN_PTRS; static struct net_generic *net_alloc_generic(void) { @@ -490,7 +490,7 @@ again: } return error; } - max_gen_ptrs = max_t(unsigned int, max_gen_ptrs, *ops->id); + max_gen_ptrs = max_t(int, max_gen_ptrs, *ops->id); } error = __register_pernet_operations(list, ops); if (error) { |