Skip to contentSkip to conversation

dmaengine: nbpfaxi: Mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 2 participants 4 messages Jul 2, 2018 – Jul 9, 2018 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: nbpfaxi: Mark expected switch fall-through

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

---
 drivers/dma/nbpfaxi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/nbpfaxi.c +1 -0
index 2f9974d..8c7b2e8 100644
@@ -479,6 +479,7 @@ static size_t nbpf_xfer_size(struct nbpf_device *nbpf,
 
 	default:
 		pr_warn("%s(): invalid bus width %u\n", __func__, width);
+		/* fall through */
 	case DMA_SLAVE_BUSWIDTH_1_BYTE:
 		size = burst;
 	}
maintainer
#1 lore raw
Quoted 13 lines · Gustavo A. R. Silva

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

---
 drivers/dma/nbpfaxi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/nbpfaxi.c +0 -0
index 2f9974d..8c7b2e8 100644

drivers/dma/nbpfaxi.c static size_t nbpf_xfer_size(struct nbpf_device *nbpf, · line 482

Quoted 4 lines
drivers/dma/nbpfaxi.c +1 -0
@@ -479,6 +479,7 @@ static size_t nbpf_xfer_size(struct nbpf_device *nbpf,
 
 	default:
 		pr_warn("%s(): invalid bus width %u\n", __func__, width);
+		/* fall through */

Hmm this looks okay but am not able to trigger this warning..(used W=1) Did you see this warning on your build, if so what options?

#2 lore raw

Hi Vinod,

Quoted 15 lines · Vinod
Quoted 14 lines · Gustavo A. R. Silva

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

---
 drivers/dma/nbpfaxi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/nbpfaxi.c +0 -0
index 2f9974d..8c7b2e8 100644
@@ -479,6 +479,7 @@ static size_t nbpf_xfer_size(struct nbpf_device *nbpf,
 
Quoted 7 lines

drivers/dma/nbpfaxi.c static size_t nbpf_xfer_size(struct nbpf_device *nbpf, · line 482

Quoted 3 lines
drivers/dma/nbpfaxi.c +1 -0
 	default:
 		pr_warn("%s(): invalid bus width %u\n", __func__, width);
+		/* fall through */

Hmm this looks okay but am not able to trigger this warning..(used W=1) Did you see this warning on your build, if so what options?

Add this to your Makefile:

KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=2)

Thanks
---
Gustavo
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw
Quoted 25 lines · Gustavo A. R. Silva

Hi Vinod,

Quoted 15 lines · Vinod
Quoted 14 lines · Gustavo A. R. Silva

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

---
 drivers/dma/nbpfaxi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/nbpfaxi.c +0 -0
index 2f9974d..8c7b2e8 100644
@@ -479,6 +479,7 @@ static size_t nbpf_xfer_size(struct nbpf_device *nbpf,
 
Quoted 6 lines

drivers/dma/nbpfaxi.c static size_t nbpf_xfer_size(struct nbpf_device *nbpf, · line 482

Quoted 3 lines
drivers/dma/nbpfaxi.c +1 -0
 	default:
 		pr_warn("%s(): invalid bus width %u\n", __func__, width);
+		/* fall through */

Hmm this looks okay but am not able to trigger this warning..(used W=1) Did you see this warning on your build, if so what options?

Quoted 3 lines

Add this to your Makefile:

KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=2)

Thanks, that did it..

Applied now thanks