[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180923133708.58171117@xps13>
Date: Sun, 23 Sep 2018 13:37:08 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Nathan Chancellor <natechancellor@...il.com>
Cc: Boris Brezillon <boris.brezillon@...tlin.com>,
Richard Weinberger <richard@....at>,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
Marek Vasut <marek.vasut@...il.com>,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH] mtd: rawnand: Use proper enum for
flctl_dma_fifo0_transfer
Hi Nathan,
Nathan Chancellor <natechancellor@...il.com> wrote on Thu, 20 Sep 2018
16:30:25 -0700:
> Clang warns when one enumerated type is converted implicitly to another:
>
> drivers/mtd/nand/raw/sh_flctl.c:483:46: warning: implicit conversion
> from enumeration type 'enum dma_transfer_direction' to different
> enumeration type 'enum dma_data_direction' [-Wenum-conversion]
> flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_DEV_TO_MEM) > 0)
> ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> drivers/mtd/nand/raw/sh_flctl.c:542:46: warning: implicit conversion
> from enumeration type 'enum dma_transfer_direction' to different
> enumeration type 'enum dma_data_direction' [-Wenum-conversion]
> flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_MEM_TO_DEV) > 0)
> ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> 2 warnings generated.
>
> Use the proper enums from dma_data_direction to satisfy Clang.
>
> DMA_MEM_TO_DEV = DMA_TO_DEVICE = 1
> DMA_DEV_TO_MEM = DMA_FROM_DEVICE = 2
>
> Reported-by: Nick Desaulniers <ndesaulniers@...gle.com>
> Signed-off-by: Nathan Chancellor <natechancellor@...il.com>
> ---
> drivers/mtd/nand/raw/sh_flctl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c
> index c0c0798f268f..4d20d033de7b 100644
> --- a/drivers/mtd/nand/raw/sh_flctl.c
> +++ b/drivers/mtd/nand/raw/sh_flctl.c
> @@ -480,7 +480,7 @@ static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset)
>
> /* initiate DMA transfer */
> if (flctl->chan_fifo0_rx && rlen >= 32 &&
> - flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_DEV_TO_MEM) > 0)
> + flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE) > 0)
> goto convert; /* DMA success */
>
> /* do polling transfer */
> @@ -539,7 +539,7 @@ static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen,
>
> /* initiate DMA transfer */
> if (flctl->chan_fifo0_tx && rlen >= 32 &&
> - flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_MEM_TO_DEV) > 0)
> + flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE) > 0)
> return; /* DMA success */
>
> /* do polling transfer */
Applied on nand/next with the subject prefix changed to
mtd: rawnand: sh_flctl:
Thanks,
Miquèl
Powered by blists - more mailing lists