summaryrefslogtreecommitdiff
path: root/net/sctp/stream_sched.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-11-28 11:00:14 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-28 11:00:14 -0500
commita51a40b7abb619c38fe60d896a6916be280171ea (patch)
tree39fb89151c14acafe4811c2b31116245f12e21c6 /net/sctp/stream_sched.c
parentf95d5bf03b5ec0d7ea8e552e15abe70c646249b5 (diff)
parent1ba896f6f52bfafac6dec4ca583cdd9a073858e8 (diff)
Merge branch 'sctp-fix-sparse-errors'
Xin Long says: ==================== sctp: fix some other sparse errors After the last fixes for sparse errors, there are still three sparse errors in sctp codes, two of them are type cast, and the other one is using extern. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/stream_sched.c')
-rw-r--r--net/sctp/stream_sched.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/net/sctp/stream_sched.c b/net/sctp/stream_sched.c
index 0b83ec51e43b..d8c162a4089c 100644
--- a/net/sctp/stream_sched.c
+++ b/net/sctp/stream_sched.c
@@ -119,16 +119,27 @@ static struct sctp_sched_ops sctp_sched_fcfs = {
.unsched_all = sctp_sched_fcfs_unsched_all,
};
+static void sctp_sched_ops_fcfs_init(void)
+{
+ sctp_sched_ops_register(SCTP_SS_FCFS, &sctp_sched_fcfs);
+}
+
/* API to other parts of the stack */
-extern struct sctp_sched_ops sctp_sched_prio;
-extern struct sctp_sched_ops sctp_sched_rr;
+static struct sctp_sched_ops *sctp_sched_ops[SCTP_SS_MAX + 1];
-static struct sctp_sched_ops *sctp_sched_ops[] = {
- &sctp_sched_fcfs,
- &sctp_sched_prio,
- &sctp_sched_rr,
-};
+void sctp_sched_ops_register(enum sctp_sched_type sched,
+ struct sctp_sched_ops *sched_ops)
+{
+ sctp_sched_ops[sched] = sched_ops;
+}
+
+void sctp_sched_ops_init(void)
+{
+ sctp_sched_ops_fcfs_init();
+ sctp_sched_ops_prio_init();
+ sctp_sched_ops_rr_init();
+}
int sctp_sched_set_sched(struct sctp_association *asoc,
enum sctp_sched_type sched)