diff options
author | Florian Westphal <fw@strlen.de> | 2015-06-17 17:58:28 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-06-18 15:14:33 -0400 |
commit | dcb8f5c8139ef945cdfd55900fae265c4dbefc02 (patch) | |
tree | 6c9a4b4e79592edf3762be44e911e1d7086109c6 | |
parent | 8f481b50ea653ff0aea6accbb4bb02a15cf00531 (diff) |
netfilter: xtables: fix warnings on 32bit platforms
On 32bit archs gcc complains due to cast from void* to u64.
Add intermediate casts to long to silence these warnings.
include/linux/netfilter/x_tables.h:376:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
include/linux/netfilter/x_tables.h:384:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
include/linux/netfilter/x_tables.h:391:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
include/linux/netfilter/x_tables.h:400:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Fixes: 71ae0dff02d756e ("netfilter: xtables: use percpu rule counters")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | include/linux/netfilter/x_tables.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 1c97a2204379..286098a5667f 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -372,7 +372,7 @@ static inline u64 xt_percpu_counter_alloc(void) | |||
372 | if (res == NULL) | 372 | if (res == NULL) |
373 | return (u64) -ENOMEM; | 373 | return (u64) -ENOMEM; |
374 | 374 | ||
375 | return (__force u64) res; | 375 | return (u64) (__force unsigned long) res; |
376 | } | 376 | } |
377 | 377 | ||
378 | return 0; | 378 | return 0; |
@@ -380,14 +380,14 @@ static inline u64 xt_percpu_counter_alloc(void) | |||
380 | static inline void xt_percpu_counter_free(u64 pcnt) | 380 | static inline void xt_percpu_counter_free(u64 pcnt) |
381 | { | 381 | { |
382 | if (nr_cpu_ids > 1) | 382 | if (nr_cpu_ids > 1) |
383 | free_percpu((void __percpu *) pcnt); | 383 | free_percpu((void __percpu *) (unsigned long) pcnt); |
384 | } | 384 | } |
385 | 385 | ||
386 | static inline struct xt_counters * | 386 | static inline struct xt_counters * |
387 | xt_get_this_cpu_counter(struct xt_counters *cnt) | 387 | xt_get_this_cpu_counter(struct xt_counters *cnt) |
388 | { | 388 | { |
389 | if (nr_cpu_ids > 1) | 389 | if (nr_cpu_ids > 1) |
390 | return this_cpu_ptr((void __percpu *) cnt->pcnt); | 390 | return this_cpu_ptr((void __percpu *) (unsigned long) cnt->pcnt); |
391 | 391 | ||
392 | return cnt; | 392 | return cnt; |
393 | } | 393 | } |
@@ -396,7 +396,7 @@ static inline struct xt_counters * | |||
396 | xt_get_per_cpu_counter(struct xt_counters *cnt, unsigned int cpu) | 396 | xt_get_per_cpu_counter(struct xt_counters *cnt, unsigned int cpu) |
397 | { | 397 | { |
398 | if (nr_cpu_ids > 1) | 398 | if (nr_cpu_ids > 1) |
399 | return per_cpu_ptr((void __percpu *) cnt->pcnt, cpu); | 399 | return per_cpu_ptr((void __percpu *) (unsigned long) cnt->pcnt, cpu); |
400 | 400 | ||
401 | return cnt; | 401 | return cnt; |
402 | } | 402 | } |