aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/stream_sched_prio.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-11-26 20:16:08 +0800
committerDavid S. Miller <davem@davemloft.net>2017-11-28 11:00:13 -0500
commit1ba896f6f52bfafac6dec4ca583cdd9a073858e8 (patch)
tree39fb89151c14acafe4811c2b31116245f12e21c6 /net/sctp/stream_sched_prio.c
parentsctp: force the params with right types for sctp csum apis (diff)
downloadlinux-dev-1ba896f6f52bfafac6dec4ca583cdd9a073858e8.tar.xz
linux-dev-1ba896f6f52bfafac6dec4ca583cdd9a073858e8.zip
sctp: remove extern from stream sched
Now each stream sched ops is defined in different .c file and added into the global ops in another .c file, it uses extern to make this work. However extern is not good coding style to get them in and even make C=2 reports errors for this. This patch adds sctp_sched_ops_xxx_init for each stream sched ops in their .c file, then get them into the global ops by calling them when initializing sctp module. Fixes: 637784ade221 ("sctp: introduce priority based stream scheduler") Fixes: ac1ed8b82cd6 ("sctp: introduce round robin stream scheduler") Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/stream_sched_prio.c')
-rw-r--r--net/sctp/stream_sched_prio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sctp/stream_sched_prio.c b/net/sctp/stream_sched_prio.c
index 384dbf3c8760..7997d35dd0fd 100644
--- a/net/sctp/stream_sched_prio.c
+++ b/net/sctp/stream_sched_prio.c
@@ -333,7 +333,7 @@ static void sctp_sched_prio_unsched_all(struct sctp_stream *stream)
sctp_sched_prio_unsched(soute);
}
-struct sctp_sched_ops sctp_sched_prio = {
+static struct sctp_sched_ops sctp_sched_prio = {
.set = sctp_sched_prio_set,
.get = sctp_sched_prio_get,
.init = sctp_sched_prio_init,
@@ -345,3 +345,8 @@ struct sctp_sched_ops sctp_sched_prio = {
.sched_all = sctp_sched_prio_sched_all,
.unsched_all = sctp_sched_prio_unsched_all,
};
+
+void sctp_sched_ops_prio_init(void)
+{
+ sctp_sched_ops_register(SCTP_SS_PRIO, &sctp_sched_prio);
+}