From: Kees Cook <keescook@chromium.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Dan Williams <dan.j.williams@intel.com>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: imx-dma: Mark expected switch fall-through
Date: Tue, 30 Jul 2019 09:58:31 -0700 [thread overview]
Message-ID: <201907300958.5F8CC90AD1@keescook> (raw)
In-Reply-To: <20190729225221.GA24269@embeddedor>
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
next prev parent reply other threads:[~2019-07-30 16:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 22:52 [PATCH] dmaengine: imx-dma: Mark expected switch fall-through Gustavo A. R. Silva
2019-07-30 16:58 ` Kees Cook [this message]
2019-07-31 15:19 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201907300958.5F8CC90AD1@keescook \
--to=keescook@chromium.org \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=gustavo@embeddedor.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).