[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181223040118.qzk4flxswf5xvckp@gondor.apana.org.au>
Date: Sun, 23 Dec 2018 12:01:18 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Nathan Chancellor <natechancellor@...il.com>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH] crypto: ux500 - Use proper enum in cryp_set_dma_transfer
On Mon, Dec 10, 2018 at 04:49:29PM -0700, Nathan Chancellor wrote:
> Clang warns when one enumerated type is implicitly converted to another:
>
> drivers/crypto/ux500/cryp/cryp_core.c:559:5: warning: implicit
> conversion from enumeration type 'enum dma_data_direction' to different
> enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
> direction, DMA_CTRL_ACK);
> ^~~~~~~~~
> drivers/crypto/ux500/cryp/cryp_core.c:583:5: warning: implicit
> conversion from enumeration type 'enum dma_data_direction' to different
> enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
> direction,
> ^~~~~~~~~
> 2 warnings generated.
>
> dmaengine_prep_slave_sg expects an enum from dma_transfer_direction.
> Because we know the value of the dma_data_direction enum from the
> switch statement, we can just use the proper value from
> dma_transfer_direction so there is no more conversion.
>
> DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1
> DMA_FROM_DEVICE = DMA_DEV_TO_MEM = 2
>
> Signed-off-by: Nathan Chancellor <natechancellor@...il.com>
> ---
> drivers/crypto/ux500/cryp/cryp_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists