netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: dst: move cpu inside ifdef to avoid compilation warning
@ 2017-10-10 22:05 Jakub Kicinski
  2017-10-10 22:56 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kicinski @ 2017-10-10 22:05 UTC (permalink / raw)
  To: netdev; +Cc: Jakub Kicinski

If CONFIG_DST_CACHE is not selected cpu variable
will be unused and we will see a compilation warning.
Move it under the ifdef.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: d66f2b91f95b ("bpf: don't rely on the verifier lock for metadata_dst allocation")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 net/core/dst.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dst.c b/net/core/dst.c
index 8b2eafac984d..662a2d4a3d19 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -325,9 +325,9 @@ EXPORT_SYMBOL_GPL(metadata_dst_alloc_percpu);
 
 void metadata_dst_free_percpu(struct metadata_dst __percpu *md_dst)
 {
+#ifdef CONFIG_DST_CACHE
 	int cpu;
 
-#ifdef CONFIG_DST_CACHE
 	for_each_possible_cpu(cpu) {
 		struct metadata_dst *one_md_dst = per_cpu_ptr(md_dst, cpu);
 
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: dst: move cpu inside ifdef to avoid compilation warning
  2017-10-10 22:05 [PATCH net-next] net: dst: move cpu inside ifdef to avoid compilation warning Jakub Kicinski
@ 2017-10-10 22:56 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-10-10 22:56 UTC (permalink / raw)
  To: jakub.kicinski; +Cc: netdev

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Tue, 10 Oct 2017 15:05:39 -0700

> If CONFIG_DST_CACHE is not selected cpu variable
> will be unused and we will see a compilation warning.
> Move it under the ifdef.
> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Fixes: d66f2b91f95b ("bpf: don't rely on the verifier lock for metadata_dst allocation")
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-10 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-10 22:05 [PATCH net-next] net: dst: move cpu inside ifdef to avoid compilation warning Jakub Kicinski
2017-10-10 22:56 ` David Miller

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).