All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: imx-dma: Mark expected switch fall-through
@ 2019-07-29 22:52 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-29 22:52 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
  Cc: dmaengine, linux-arm-kernel, linux-kernel, Gustavo A. R. Silva,
	Kees Cook

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: arm):

drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (slot == IMX_DMA_2D_SLOT_A) {
      ^
drivers/dma/imx-dma.c:559:2: note: here
  case IMXDMA_DESC_MEMCPY:
  ^~~~

Notice that, in this particular case, the code comment is
modified in accordance with what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/dma/imx-dma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 00a089e24150..5c0fb3134825 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -556,6 +556,7 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
 		 * We fall-through here intentionally, since a 2D transfer is
 		 * similar to MEMCPY just adding the 2D slot configuration.
 		 */
+		/* Fall through */
 	case IMXDMA_DESC_MEMCPY:
 		imx_dmav1_writel(imxdma, d->src, DMA_SAR(imxdmac->channel));
 		imx_dmav1_writel(imxdma, d->dest, DMA_DAR(imxdmac->channel));
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] dmaengine: imx-dma: Mark expected switch fall-through
@ 2019-07-29 22:52 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-29 22:52 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
  Cc: dmaengine, Kees Cook, linux-kernel, linux-arm-kernel,
	Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: arm):

drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (slot == IMX_DMA_2D_SLOT_A) {
      ^
drivers/dma/imx-dma.c:559:2: note: here
  case IMXDMA_DESC_MEMCPY:
  ^~~~

Notice that, in this particular case, the code comment is
modified in accordance with what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/dma/imx-dma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 00a089e24150..5c0fb3134825 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -556,6 +556,7 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
 		 * We fall-through here intentionally, since a 2D transfer is
 		 * similar to MEMCPY just adding the 2D slot configuration.
 		 */
+		/* Fall through */
 	case IMXDMA_DESC_MEMCPY:
 		imx_dmav1_writel(imxdma, d->src, DMA_SAR(imxdmac->channel));
 		imx_dmav1_writel(imxdma, d->dest, DMA_DAR(imxdmac->channel));
-- 
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] 6+ messages in thread

* Re: [PATCH] dmaengine: imx-dma: Mark expected switch fall-through
  2019-07-29 22:52 ` Gustavo A. R. Silva
@ 2019-07-30 16:58   ` Kees Cook
  -1 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2019-07-30 16:58 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Vinod Koul, Dan Williams, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	dmaengine, linux-arm-kernel, linux-kernel

On Mon, Jul 29, 2019 at 05:52:21PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
> 
> This patch fixes the following warning (Building: arm):
> 
> drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
> drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (slot == IMX_DMA_2D_SLOT_A) {
>       ^
> drivers/dma/imx-dma.c:559:2: note: here
>   case IMXDMA_DESC_MEMCPY:
>   ^~~~
> 
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/dma/imx-dma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
> index 00a089e24150..5c0fb3134825 100644
> --- a/drivers/dma/imx-dma.c
> +++ b/drivers/dma/imx-dma.c
> @@ -556,6 +556,7 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
>  		 * We fall-through here intentionally, since a 2D transfer is
>  		 * similar to MEMCPY just adding the 2D slot configuration.
>  		 */
> +		/* Fall through */
>  	case IMXDMA_DESC_MEMCPY:
>  		imx_dmav1_writel(imxdma, d->src, DMA_SAR(imxdmac->channel));
>  		imx_dmav1_writel(imxdma, d->dest, DMA_DAR(imxdmac->channel));
> -- 
> 2.22.0
> 

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: imx-dma: Mark expected switch fall-through
@ 2019-07-30 16:58   ` Kees Cook
  0 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2019-07-30 16:58 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Shawn Guo, Sascha Hauer, linux-kernel, Vinod Koul,
	NXP Linux Team, Pengutronix Kernel Team, dmaengine, Dan Williams,
	Fabio Estevam, linux-arm-kernel

On Mon, Jul 29, 2019 at 05:52:21PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
> 
> This patch fixes the following warning (Building: arm):
> 
> drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
> drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (slot == IMX_DMA_2D_SLOT_A) {
>       ^
> drivers/dma/imx-dma.c:559:2: note: here
>   case IMXDMA_DESC_MEMCPY:
>   ^~~~
> 
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/dma/imx-dma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
> index 00a089e24150..5c0fb3134825 100644
> --- a/drivers/dma/imx-dma.c
> +++ b/drivers/dma/imx-dma.c
> @@ -556,6 +556,7 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
>  		 * We fall-through here intentionally, since a 2D transfer is
>  		 * similar to MEMCPY just adding the 2D slot configuration.
>  		 */
> +		/* Fall through */
>  	case IMXDMA_DESC_MEMCPY:
>  		imx_dmav1_writel(imxdma, d->src, DMA_SAR(imxdmac->channel));
>  		imx_dmav1_writel(imxdma, d->dest, DMA_DAR(imxdmac->channel));
> -- 
> 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] 6+ messages in thread

* Re: [PATCH] dmaengine: imx-dma: Mark expected switch fall-through
  2019-07-29 22:52 ` Gustavo A. R. Silva
@ 2019-07-31 15:19   ` Vinod Koul
  -1 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2019-07-31 15:19 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Dan Williams, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, dmaengine, linux-arm-kernel,
	linux-kernel, Kees Cook

On 29-07-19, 17:52, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
> 
> This patch fixes the following warning (Building: arm):
> 
> drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
> drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (slot == IMX_DMA_2D_SLOT_A) {
>       ^
> drivers/dma/imx-dma.c:559:2: note: here
>   case IMXDMA_DESC_MEMCPY:
>   ^~~~
> 
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: imx-dma: Mark expected switch fall-through
@ 2019-07-31 15:19   ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2019-07-31 15:19 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kees Cook, Shawn Guo, Sascha Hauer, linux-kernel, NXP Linux Team,
	Pengutronix Kernel Team, dmaengine, Dan Williams, Fabio Estevam,
	linux-arm-kernel

On 29-07-19, 17:52, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
> 
> This patch fixes the following warning (Building: arm):
> 
> drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
> drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (slot == IMX_DMA_2D_SLOT_A) {
>       ^
> drivers/dma/imx-dma.c:559:2: note: here
>   case IMXDMA_DESC_MEMCPY:
>   ^~~~
> 
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.

Applied, thanks

-- 
~Vinod

_______________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2019-07-31 15:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 22:52 [PATCH] dmaengine: imx-dma: Mark expected switch fall-through Gustavo A. R. Silva
2019-07-29 22:52 ` Gustavo A. R. Silva
2019-07-30 16:58 ` Kees Cook
2019-07-30 16:58   ` Kees Cook
2019-07-31 15:19 ` Vinod Koul
2019-07-31 15:19   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.