netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net-next] net_sched: fix a compile warning in act_ife
@ 2017-10-13 19:58 Cong Wang
  2017-10-13 20:16 ` Roman Mashak
  2017-10-15  1:44 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Cong Wang @ 2017-10-13 19:58 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, Roman Mashak

Apparently ife_meta_id2name() is only called when
CONFIG_MODULES is defined.

This fixes:

net/sched/act_ife.c:251:20: warning: ‘ife_meta_id2name’ defined but not used [-Wunused-function]
 static const char *ife_meta_id2name(u32 metaid)
                    ^~~~~~~~~~~~~~~~

Fixes: d3f24ba895f0 ("net sched actions: fix module auto-loading")
Cc: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/sched/act_ife.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
index 252ee7d8c731..3007cb1310ea 100644
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -248,6 +248,7 @@ static int ife_validate_metatype(struct tcf_meta_ops *ops, void *val, int len)
 	return ret;
 }
 
+#ifdef CONFIG_MODULES
 static const char *ife_meta_id2name(u32 metaid)
 {
 	switch (metaid) {
@@ -261,6 +262,7 @@ static const char *ife_meta_id2name(u32 metaid)
 		return "unknown";
 	}
 }
+#endif
 
 /* called when adding new meta information
  * under ife->tcf_lock for existing action
-- 
2.13.0

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

* Re: [Patch net-next] net_sched: fix a compile warning in act_ife
  2017-10-13 19:58 [Patch net-next] net_sched: fix a compile warning in act_ife Cong Wang
@ 2017-10-13 20:16 ` Roman Mashak
  2017-10-15  1:44 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Roman Mashak @ 2017-10-13 20:16 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev

Cong Wang <xiyou.wangcong@gmail.com> writes:

> Apparently ife_meta_id2name() is only called when
> CONFIG_MODULES is defined.
>
> This fixes:
>
> net/sched/act_ife.c:251:20: warning: ‘ife_meta_id2name’ defined but not used [-Wunused-function]
>  static const char *ife_meta_id2name(u32 metaid)
>                     ^~~~~~~~~~~~~~~~

Fair enough, thanks Cong!

> Fixes: d3f24ba895f0 ("net sched actions: fix module auto-loading")
> Cc: Roman Mashak <mrv@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
>  net/sched/act_ife.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
> index 252ee7d8c731..3007cb1310ea 100644
> --- a/net/sched/act_ife.c
> +++ b/net/sched/act_ife.c
> @@ -248,6 +248,7 @@ static int ife_validate_metatype(struct tcf_meta_ops *ops, void *val, int len)
>  	return ret;
>  }
>  
> +#ifdef CONFIG_MODULES
>  static const char *ife_meta_id2name(u32 metaid)
>  {
>  	switch (metaid) {
> @@ -261,6 +262,7 @@ static const char *ife_meta_id2name(u32 metaid)
>  		return "unknown";
>  	}
>  }
> +#endif
>  
>  /* called when adding new meta information
>   * under ife->tcf_lock for existing action

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

* Re: [Patch net-next] net_sched: fix a compile warning in act_ife
  2017-10-13 19:58 [Patch net-next] net_sched: fix a compile warning in act_ife Cong Wang
  2017-10-13 20:16 ` Roman Mashak
@ 2017-10-15  1:44 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-10-15  1:44 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, mrv

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Fri, 13 Oct 2017 12:58:13 -0700

> Apparently ife_meta_id2name() is only called when
> CONFIG_MODULES is defined.
> 
> This fixes:
> 
> net/sched/act_ife.c:251:20: warning: ‘ife_meta_id2name’ defined but not used [-Wunused-function]
>  static const char *ife_meta_id2name(u32 metaid)
>                     ^~~~~~~~~~~~~~~~
> 
> Fixes: d3f24ba895f0 ("net sched actions: fix module auto-loading")
> Cc: Roman Mashak <mrv@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

end of thread, other threads:[~2017-10-15  1:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13 19:58 [Patch net-next] net_sched: fix a compile warning in act_ife Cong Wang
2017-10-13 20:16 ` Roman Mashak
2017-10-15  1:44 ` 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).