Skip to contentSkip to conversation

net: sched: move rtm_tca_policy declaration to include file

PATCH Applied Eric Dumazet 3 participants 3 messages Jun 6, 2023 – Jun 7, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sched: move rtm_tca_policy declaration to include file

rtm_tca_policy is used from net/sched/sch_api.c and net/sched/cls_api.c, thus should be declared in an include file.

This fixes the following sparse warning:
net/sched/sch_api.c:1434:25: warning: symbol 'rtm_tca_policy' was not declared. Should it be static?

Fixes e331473fee3d ("net/sched: cls_api: add missing validation of netlink attributes")
---
 include/net/pkt_sched.h | 2 ++
 net/sched/cls_api.c     | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/pkt_sched.h +2 -0
index f436688b6efc8f20ee5ede6ee94404e22bbebf3f..5722931d83d431d8cc625d44ba2bc22d88301d5b 100644
@@ -127,6 +127,8 @@ static inline void qdisc_run(struct Qdisc *q)
 	}
 }
 
+extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1];
+
 /* Calculate maximal size of packet seen by hard_start_xmit
    routine of this device.
  */
net/sched/cls_api.c +0 -2
index 2621550bfddc1e466b6a03b0ce6eb5de25ab7476..b2432ee04f3193f6bbcb7986fd950d470fd28e55 100644
@@ -43,8 +43,6 @@
 #include <net/flow_offload.h>
 #include <net/tc_wrapper.h>
 
-extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1];
-
 /* The list of all installed classifier types */
 static LIST_HEAD(tcf_proto_base);
 
Signature · 1 line
2.41.0.rc0.172.g3f132b7071-goog
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Eric Dumazet

rtm_tca_policy is used from net/sched/sch_api.c and net/sched/cls_api.c, thus should be declared in an include file.

This fixes the following sparse warning:
net/sched/sch_api.c:1434:25: warning: symbol 'rtm_tca_policy' was not declared. Should it be static?

Fixes e331473fee3d ("net/sched: cls_api: add missing validation of netlink attributes")

cheers,
jamal

Quoted 33 lines
 include/net/pkt_sched.h | 2 ++
 net/sched/cls_api.c     | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/pkt_sched.h +2 -0
index f436688b6efc8f20ee5ede6ee94404e22bbebf3f..5722931d83d431d8cc625d44ba2bc22d88301d5b 100644
@@ -127,6 +127,8 @@ static inline void qdisc_run(struct Qdisc *q)
        }
 }
 
+extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1];
+
 /* Calculate maximal size of packet seen by hard_start_xmit
    routine of this device.
  */
net/sched/cls_api.c +0 -3
index 2621550bfddc1e466b6a03b0ce6eb5de25ab7476..b2432ee04f3193f6bbcb7986fd950d470fd28e55 100644
@@ -43,8 +43,6 @@
 #include <net/flow_offload.h>
 #include <net/tc_wrapper.h>
 
-extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1];
-
 /* The list of all installed classifier types */
 static LIST_HEAD(tcf_proto_base);
 
--

2.41.0.rc0.172.g3f132b7071-goog

#2 lore raw
In reply to Eric Dumazet
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 10 lines · On Tue, 6 Jun 2023 11:42:33 +0000 you wrote:

rtm_tca_policy is used from net/sched/sch_api.c and net/sched/cls_api.c, thus should be declared in an include file.

This fixes the following sparse warning:
net/sched/sch_api.c:1434:25: warning: symbol 'rtm_tca_policy' was not declared. Should it be static?

Fixes e331473fee3d ("net/sched: cls_api: add missing validation of netlink attributes")

[...]

Here is the summary with links:
- [net] net: sched: move rtm_tca_policy declaration to include file

    https://git.kernel.org/netdev/net/c/886bc7d6ed33

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html