* [PATCH] ARM: OMAP: dma: Mark expected switch fall-throughs
@ 2019-07-28 23:22 Gustavo A. R. Silva
2019-07-29 16:34 ` Kees Cook
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-28 23:22 UTC (permalink / raw)
To: Aaro Koskinen, Tony Lindgren, Russell King
Cc: Stephen Rothwell, Kees Cook, Gustavo A. R. Silva, linux-kernel,
linux-omap, linux-arm-kernel
Mark switch cases where we are expecting to fall through.
This patch fixes the following warnings:
arch/arm/plat-omap/dma.c: In function 'omap_set_dma_src_burst_mode':
arch/arm/plat-omap/dma.c:384:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dma_omap2plus()) {
^
arch/arm/plat-omap/dma.c:393:2: note: here
case OMAP_DMA_DATA_BURST_16:
^~~~
arch/arm/plat-omap/dma.c:394:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dma_omap2plus()) {
^
arch/arm/plat-omap/dma.c:402:2: note: here
default:
^~~~~~~
arch/arm/plat-omap/dma.c: In function 'omap_set_dma_dest_burst_mode':
arch/arm/plat-omap/dma.c:473:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dma_omap2plus()) {
^
arch/arm/plat-omap/dma.c:481:2: note: here
default:
^~~~~~~
Notice that, in this particular case, the code comment is
modified in accordance with what GCC is expecting to find.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
arch/arm/plat-omap/dma.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 79f43acf9acb..08c99413d02c 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -388,17 +388,15 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
/*
* not supported by current hardware on OMAP1
* w |= (0x03 << 7);
- * fall through
*/
+ /* fall through */
case OMAP_DMA_DATA_BURST_16:
if (dma_omap2plus()) {
burst = 0x3;
break;
}
- /*
- * OMAP1 don't support burst 16
- * fall through
- */
+ /* OMAP1 don't support burst 16 */
+ /* fall through */
default:
BUG();
}
@@ -474,10 +472,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
burst = 0x3;
break;
}
- /*
- * OMAP1 don't support burst 16
- * fall through
- */
+ /* OMAP1 don't support burst 16 */
+ /* fall through */
default:
printk(KERN_ERR "Invalid DMA burst mode\n");
BUG();
--
2.22.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: OMAP: dma: Mark expected switch fall-throughs
2019-07-28 23:22 [PATCH] ARM: OMAP: dma: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-07-29 16:34 ` Kees Cook
2019-08-13 12:00 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2019-07-29 16:34 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Stephen Rothwell, Aaro Koskinen, Tony Lindgren, linux-kernel,
Russell King, linux-omap, linux-arm-kernel
On Sun, Jul 28, 2019 at 06:22:40PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> arch/arm/plat-omap/dma.c: In function 'omap_set_dma_src_burst_mode':
> arch/arm/plat-omap/dma.c:384:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (dma_omap2plus()) {
> ^
> arch/arm/plat-omap/dma.c:393:2: note: here
> case OMAP_DMA_DATA_BURST_16:
> ^~~~
> arch/arm/plat-omap/dma.c:394:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (dma_omap2plus()) {
> ^
> arch/arm/plat-omap/dma.c:402:2: note: here
> default:
> ^~~~~~~
> arch/arm/plat-omap/dma.c: In function 'omap_set_dma_dest_burst_mode':
> arch/arm/plat-omap/dma.c:473:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (dma_omap2plus()) {
> ^
> arch/arm/plat-omap/dma.c:481:2: note: here
> default:
> ^~~~~~~
>
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> arch/arm/plat-omap/dma.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
> index 79f43acf9acb..08c99413d02c 100644
> --- a/arch/arm/plat-omap/dma.c
> +++ b/arch/arm/plat-omap/dma.c
> @@ -388,17 +388,15 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
> /*
> * not supported by current hardware on OMAP1
> * w |= (0x03 << 7);
> - * fall through
> */
> + /* fall through */
> case OMAP_DMA_DATA_BURST_16:
> if (dma_omap2plus()) {
> burst = 0x3;
> break;
> }
> - /*
> - * OMAP1 don't support burst 16
> - * fall through
> - */
> + /* OMAP1 don't support burst 16 */
> + /* fall through */
> default:
> BUG();
> }
> @@ -474,10 +472,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
> burst = 0x3;
> break;
> }
> - /*
> - * OMAP1 don't support burst 16
> - * fall through
> - */
> + /* OMAP1 don't support burst 16 */
> + /* fall through */
> default:
> printk(KERN_ERR "Invalid DMA burst mode\n");
> BUG();
> --
> 2.22.0
>
--
Kees Cook
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: OMAP: dma: Mark expected switch fall-throughs
2019-07-29 16:34 ` Kees Cook
@ 2019-08-13 12:00 ` Tony Lindgren
0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2019-08-13 12:00 UTC (permalink / raw)
To: Kees Cook
Cc: Stephen Rothwell, Aaro Koskinen, Gustavo A. R. Silva,
linux-kernel, Russell King, linux-omap, linux-arm-kernel
* Kees Cook <keescook@chromium.org> [190729 16:35]:
> On Sun, Jul 28, 2019 at 06:22:40PM -0500, Gustavo A. R. Silva wrote:
> > Mark switch cases where we are expecting to fall through.
> >
> > This patch fixes the following warnings:
> >
> > arch/arm/plat-omap/dma.c: In function 'omap_set_dma_src_burst_mode':
> > arch/arm/plat-omap/dma.c:384:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > if (dma_omap2plus()) {
> > ^
> > arch/arm/plat-omap/dma.c:393:2: note: here
> > case OMAP_DMA_DATA_BURST_16:
> > ^~~~
> > arch/arm/plat-omap/dma.c:394:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > if (dma_omap2plus()) {
> > ^
> > arch/arm/plat-omap/dma.c:402:2: note: here
> > default:
> > ^~~~~~~
> > arch/arm/plat-omap/dma.c: In function 'omap_set_dma_dest_burst_mode':
> > arch/arm/plat-omap/dma.c:473:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > if (dma_omap2plus()) {
> > ^
> > arch/arm/plat-omap/dma.c:481:2: note: here
> > default:
> > ^~~~~~~
> >
> > Notice that, in this particular case, the code comment is
> > modified in accordance with what GCC is expecting to find.
> >
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
Applying into fixes thanks.
Tony
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-13 12:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-28 23:22 [PATCH] ARM: OMAP: dma: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-29 16:34 ` Kees Cook
2019-08-13 12:00 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).