Skip to contentSkip to conversation

ntb: ntb_transport: Mark expected switch fall-throughs

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Oct 5, 2018 – Oct 31, 2018 NTB driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntb: ntb_transport: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1373888 ("Missing break in switch")
Addresses-Coverity-ID: 1373889 ("Missing break in switch")

---
 drivers/ntb/ntb_transport.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/ntb/ntb_transport.c +2 -0
index 9398959..c643b9c 100644
@@ -1278,6 +1278,7 @@ static void ntb_rx_copy_callback(void *data,
 		case DMA_TRANS_READ_FAILED:
 		case DMA_TRANS_WRITE_FAILED:
 			entry->errors++;
+			/* fall through */
 		case DMA_TRANS_ABORTED:
 		{
 			struct ntb_transport_qp *qp = entry->qp;
@@ -1533,6 +1534,7 @@ static void ntb_tx_copy_callback(void *data,
 		case DMA_TRANS_READ_FAILED:
 		case DMA_TRANS_WRITE_FAILED:
 			entry->errors++;
+			/* fall through */
 		case DMA_TRANS_ABORTED:
 		{
 			void __iomem *offset =
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1373888 ("Missing break in switch")
Addresses-Coverity-ID: 1373889 ("Missing break in switch")

Quoted 26 lines
---
 drivers/ntb/ntb_transport.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/ntb/ntb_transport.c +2 -1
index 9398959..c643b9c 100644
@@ -1278,6 +1278,7 @@ static void ntb_rx_copy_callback(void *data,
                case DMA_TRANS_READ_FAILED:
                case DMA_TRANS_WRITE_FAILED:
                        entry->errors++;
+                       /* fall through */
                case DMA_TRANS_ABORTED:
                {
                        struct ntb_transport_qp *qp = entry->qp;
@@ -1533,6 +1534,7 @@ static void ntb_tx_copy_callback(void *data,
                case DMA_TRANS_READ_FAILED:
                case DMA_TRANS_WRITE_FAILED:
                        entry->errors++;
+                       /* fall through */
                case DMA_TRANS_ABORTED:
                {
                        void __iomem *offset =
--

2.7.4

maintainer Applied
#2 lore raw
Quoted 10 lines · Allen Hubbe
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1373888 ("Missing break in switch")
Addresses-Coverity-ID: 1373889 ("Missing break in switch")

Applied

Thanks,
Jon

Quoted 27 lines
Quoted 27 lines
---
 drivers/ntb/ntb_transport.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/ntb/ntb_transport.c +2 -1
index 9398959..c643b9c 100644
@@ -1278,6 +1278,7 @@ static void ntb_rx_copy_callback(void *data,
                case DMA_TRANS_READ_FAILED:
                case DMA_TRANS_WRITE_FAILED:
                        entry->errors++;
+                       /* fall through */
                case DMA_TRANS_ABORTED:
                {
                        struct ntb_transport_qp *qp = entry->qp;
@@ -1533,6 +1534,7 @@ static void ntb_tx_copy_callback(void *data,
                case DMA_TRANS_READ_FAILED:
                case DMA_TRANS_WRITE_FAILED:
                        entry->errors++;
+                       /* fall through */
                case DMA_TRANS_ABORTED:
                {
                        void __iomem *offset =
--

2.7.4