Skip to contentSkip to conversation

net_sched: fix a compile warning in act_ife

PATCH Applied Cong Wang 3 participants 3 messages Oct 13, 2017 – Oct 15, 2017

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 net_sched: fix a compile warning in act_ife

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 <[email protected]>
---
 net/sched/act_ife.c | 2 ++
 1 file changed, 2 insertions(+)
net/sched/act_ife.c +2 -0
index 252ee7d8c731..3007cb1310ea 100644
@@ -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
Signature · 1 line
2.13.0
#1 lore raw
Quoted 8 lines · Cong Wang

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!

Quoted 27 lines
Fixes d3f24ba895f0 ("net sched actions: fix module auto-loading")
Cc Roman Mashak <[email protected]>
---
 net/sched/act_ife.c | 2 ++
 1 file changed, 2 insertions(+)
net/sched/act_ife.c +2 -0
index 252ee7d8c731..3007cb1310ea 100644
@@ -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
maintainer Applied
#2 lore raw
In reply to Cong Wang

From: Cong Wang <[email protected]>
Date: Fri, 13 Oct 2017 12:58:13 -0700

Quoted 5 lines

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

This fixes:

Quoted 7 lines

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 <[email protected]>

Applied.