From: John Fastabend <john.fastabend@gmail.com>
To: xiyou.wangcong@gmail.com, davem@davemloft.net, eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, jhs@mojatatu.com
Subject: [net-next PATCH v2 1/4] net: sched: fix unsued cpu variable
Date: Mon, 15 Sep 2014 23:30:26 -0700 [thread overview]
Message-ID: <20140916063024.2905.55403.stgit@nitbit.x32> (raw)
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.
'commit 459d5f626da7 ("net: sched: make cls_u32 per cpu")'
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
net/sched/cls_u32.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 5ed5ac4..8cffe5a 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;
}
next reply other threads:[~2014-09-16 6:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-16 6:30 John Fastabend [this message]
2014-09-16 6:30 ` [net-next PATCH v2 2/4] net: sched: cls_u32 add missing rcu_assign_pointer and annotation John Fastabend
2014-09-16 20:00 ` David Miller
2014-09-16 6:31 ` [net-next PATCH v2 3/4] net: sched: cls_cgroup fix possible memory leak of 'new' John Fastabend
2014-09-16 16:19 ` Cong Wang
2014-09-16 20:00 ` David Miller
2014-09-16 6:31 ` [net-next PATCH v2 4/4] net: sched: cls_fw: add missing tcf_exts_init call in fw_change() John Fastabend
2014-09-16 16:23 ` Cong Wang
2014-09-16 20:00 ` David Miller
2014-09-16 20:27 ` John Fastabend
2014-09-16 16:17 ` [net-next PATCH v2 1/4] net: sched: fix unsued cpu variable Cong Wang
2014-09-16 20:00 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140916063024.2905.55403.stgit@nitbit.x32 \
--to=john.fastabend@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).