aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_u32.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2014-09-15 23:30:26 -0700
committerDavid S. Miller <davem@davemloft.net>2014-09-16 15:59:36 -0400
commit80aab73de4a076fc70ad5cc60395d935c40e605d (patch)
tree894965a07b8077c8c1eaf07d256f6f693709ae75 /net/sched/cls_u32.c
parentnet_sched: fix a null pointer dereference in tcindex_set_parms() (diff)
downloadlinux-dev-80aab73de4a076fc70ad5cc60395d935c40e605d.tar.xz
linux-dev-80aab73de4a076fc70ad5cc60395d935c40e605d.zip
net: sched: fix unsued cpu variable
kbuild test robot reported an unused variable cpu in cls_u32.c after the patch below. This happens when PERF and MARK config variables are disabled Fix this is to use separate variables for perf and mark and define the cpu variable inside the ifdef logic. Fixes: 459d5f626da7 ("net: sched: make cls_u32 per cpu")' Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Cong Wang <cwang@twopensource.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_u32.c')
-rw-r--r--net/sched/cls_u32.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 5ed5ac4361b1..8cffe5a27007 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -788,8 +788,8 @@ static int u32_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
} else {
#ifdef CONFIG_CLS_U32_PERF
struct tc_u32_pcnt *gpf;
-#endif
int cpu;
+#endif
if (nla_put(skb, TCA_U32_SEL,
sizeof(n->sel) + n->sel.nkeys*sizeof(struct tc_u32_key),
@@ -816,9 +816,10 @@ static int u32_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct tc_u32_mark mark = {.val = n->val,
.mask = n->mask,
.success = 0};
+ int cpum;
- for_each_possible_cpu(cpu) {
- __u32 cnt = *per_cpu_ptr(n->pcpu_success, cpu);
+ for_each_possible_cpu(cpum) {
+ __u32 cnt = *per_cpu_ptr(n->pcpu_success, cpum);
mark.success += cnt;
}