net: sched: mark expected switch fall-throughs
Subsystems (3)
PATCH 1/1 net: sched: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Signed-off-by Gustavo A. R. Silva <[email protected]>
---
This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of the code is to fall through.
net/sched/sch_cbq.c | 1 + net/sched/sch_drr.c | 1 + net/sched/sch_fq_codel.c | 1 + net/sched/sch_hfsc.c | 1 + net/sched/sch_htb.c | 1 + net/sched/sch_multiq.c | 1 + net/sched/sch_prio.c | 1 + net/sched/sch_qfq.c | 1 + net/sched/sch_sfb.c | 1 + net/sched/sch_sfq.c | 1 + 10 files changed, 10 insertions(+)
net/sched/sch_cbq.c +1 -0
@@ -255,6 +255,7 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)case TC_ACT_STOLEN :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return NULL ;case TC_ACT_RECLASSIFY :
net/sched/sch_drr.c +1 -0
@@ -321,6 +321,7 @@ static struct drr_class *drr_classify(struct sk_buff *skb, struct Qdisc *sch,case TC_ACT_STOLEN :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return NULL ; }
net/sched/sch_fq_codel.c +1 -0
@@ -105,6 +105,7 @@ static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch,case TC_ACT_QUEUED :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return 0 ; }
net/sched/sch_hfsc.c +1 -0
@@ -1144,6 +1144,7 @@ hfsc_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)case TC_ACT_STOLEN :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return NULL ; }
net/sched/sch_htb.c +1 -0
@@ -244,6 +244,7 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch,case TC_ACT_STOLEN :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return NULL ; }
net/sched/sch_multiq.c +1 -0
@@ -54,6 +54,7 @@ multiq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)case TC_ACT_QUEUED :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return NULL ; }
net/sched/sch_prio.c +1 -0
@@ -50,6 +50,7 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)case TC_ACT_QUEUED :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return NULL ; }
net/sched/sch_qfq.c +1 -0
@@ -709,6 +709,7 @@ static struct qfq_class *qfq_classify(struct sk_buff *skb, struct Qdisc *sch,case TC_ACT_STOLEN :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return NULL ; }
net/sched/sch_sfb.c +1 -0
@@ -268,6 +268,7 @@ static bool sfb_classify(struct sk_buff *skb, struct tcf_proto *fl,case TC_ACT_QUEUED :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return false; }
net/sched/sch_sfq.c +1 -0
@@ -189,6 +189,7 @@ static unsigned int sfq_classify(struct sk_buff *skb, struct Qdisc *sch,case TC_ACT_QUEUED :case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; +/* fall through */ case TC_ACT_SHOT :return 0 ; }
Signature · 1 line
2.7.4
From: "Gustavo A. R. Silva" <[email protected]>
Date: Thu, 19 Oct 2017 16:28:24 -0500
Quoted 4 lines
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Signed-off-by Gustavo A. R. Silva <[email protected]>
Applied.