All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Corentin Labbe <clabbe@baylibre.com>
Cc: davem@davemloft.net, mripard@kernel.org, wens@csie.org,
	linux-arm-kernel@lists.infradead.org,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-sunxi@googlegroups.com
Subject: Re: [PATCH v6 09/18] crypto: sun8i-ce: split into prepare/run/unprepare
Date: Fri, 11 Sep 2020 16:36:31 +1000	[thread overview]
Message-ID: <20200911063631.GA19560@gondor.apana.org.au> (raw)
In-Reply-To: <1599217803-29755-10-git-send-email-clabbe@baylibre.com>

On Fri, Sep 04, 2020 at 11:09:54AM +0000, Corentin Labbe wrote:
>
> +static int sun8i_ce_cipher_unprepare(struct crypto_engine *engine, void *async_req)
> +{
> +	struct skcipher_request *areq = container_of(async_req, struct skcipher_request, base);
> +	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(areq);
> +	struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm);
> +	struct sun8i_ce_dev *ce = op->ce;
> +	struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq);
> +	struct sun8i_ce_flow *chan;
> +	struct ce_task *cet;
> +	unsigned int ivsize, offset;
> +	int nr_sgs = rctx->nr_sgs;
> +	int nr_sgd = rctx->nr_sgd;
> +	int flow;
> +
> +	flow = rctx->flow;
> +	chan = &ce->chanlist[flow];
> +	cet = chan->tl;
> +	ivsize = crypto_skcipher_ivsize(tfm);
> +
> +	if (areq->src == areq->dst) {
> +		dma_unmap_sg(ce->dev, areq->src, nr_sgs, DMA_BIDIRECTIONAL);
> +	} else {
> +		if (nr_sgs > 0)
> +			dma_unmap_sg(ce->dev, areq->src, nr_sgs, DMA_TO_DEVICE);
> +		dma_unmap_sg(ce->dev, areq->dst, nr_sgd, DMA_FROM_DEVICE);
> +	}
> +
> +	if (areq->iv && ivsize > 0) {
> +		if (cet->t_iv)
> +			dma_unmap_single(ce->dev, cet->t_iv, rctx->ivlen,
> +					 DMA_TO_DEVICE);

This creates a sparse warning:

  CHECK   ../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25: warning: incorrect type in argument 2 (different base types)
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25:    expected unsigned long long [usertype] addr
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25:    got restricted __le32 [usertype] t_iv
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9: warning: incorrect type in argument 2 (different base types)
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9:    expected unsigned long long [usertype] addr
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9:    got restricted __le32 [usertype] t_key

Please fix.  Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

WARNING: multiple messages have this Message-ID (diff)
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Corentin Labbe <clabbe@baylibre.com>
Cc: linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org,
	mripard@kernel.org, wens@csie.org, linux-crypto@vger.kernel.org,
	davem@davemloft.net, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v6 09/18] crypto: sun8i-ce: split into prepare/run/unprepare
Date: Fri, 11 Sep 2020 16:36:31 +1000	[thread overview]
Message-ID: <20200911063631.GA19560@gondor.apana.org.au> (raw)
In-Reply-To: <1599217803-29755-10-git-send-email-clabbe@baylibre.com>

On Fri, Sep 04, 2020 at 11:09:54AM +0000, Corentin Labbe wrote:
>
> +static int sun8i_ce_cipher_unprepare(struct crypto_engine *engine, void *async_req)
> +{
> +	struct skcipher_request *areq = container_of(async_req, struct skcipher_request, base);
> +	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(areq);
> +	struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm);
> +	struct sun8i_ce_dev *ce = op->ce;
> +	struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq);
> +	struct sun8i_ce_flow *chan;
> +	struct ce_task *cet;
> +	unsigned int ivsize, offset;
> +	int nr_sgs = rctx->nr_sgs;
> +	int nr_sgd = rctx->nr_sgd;
> +	int flow;
> +
> +	flow = rctx->flow;
> +	chan = &ce->chanlist[flow];
> +	cet = chan->tl;
> +	ivsize = crypto_skcipher_ivsize(tfm);
> +
> +	if (areq->src == areq->dst) {
> +		dma_unmap_sg(ce->dev, areq->src, nr_sgs, DMA_BIDIRECTIONAL);
> +	} else {
> +		if (nr_sgs > 0)
> +			dma_unmap_sg(ce->dev, areq->src, nr_sgs, DMA_TO_DEVICE);
> +		dma_unmap_sg(ce->dev, areq->dst, nr_sgd, DMA_FROM_DEVICE);
> +	}
> +
> +	if (areq->iv && ivsize > 0) {
> +		if (cet->t_iv)
> +			dma_unmap_single(ce->dev, cet->t_iv, rctx->ivlen,
> +					 DMA_TO_DEVICE);

This creates a sparse warning:

  CHECK   ../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25: warning: incorrect type in argument 2 (different base types)
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25:    expected unsigned long long [usertype] addr
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25:    got restricted __le32 [usertype] t_iv
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9: warning: incorrect type in argument 2 (different base types)
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9:    expected unsigned long long [usertype] addr
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9:    got restricted __le32 [usertype] t_key

Please fix.  Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-09-11  6:37 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 11:09 [PATCH v6 00/18] crypto: allwinner: add xRNG and hashes Corentin Labbe
2020-09-04 11:09 ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 01/18] crypto: sun8i-ss: Add SS_START define Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 02/18] crypto: sun8i-ss: Add support for the PRNG Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 03/18] crypto: sun8i-ss: support hash algorithms Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 04/18] crypto: sun8i-ss: fix a trivial typo Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 05/18] crypto: sun8i-ss: Add more comment on some structures Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 06/18] crypto: sun8i-ss: better debug printing Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 07/18] crypto: sun8i-ce: handle endianness of t_common_ctl Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 08/18] crypto: sun8i-ce: move iv data to request context Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 09/18] crypto: sun8i-ce: split into prepare/run/unprepare Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-11  6:36   ` Herbert Xu [this message]
2020-09-11  6:36     ` Herbert Xu
2020-09-04 11:09 ` [PATCH v6 10/18] crypto: sun8i-ce: handle different error registers Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 11/18] crypto: sun8i-ce: rename has_t_dlen_in_bytes to cipher_t_dlen_in_bytes Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 12/18] crypto: sun8i-ce: support hash algorithms Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 13/18] crypto: sun8i-ce: Add stat_bytes debugfs Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:09 ` [PATCH v6 14/18] crypto: sun8i-ce: Add support for the PRNG Corentin Labbe
2020-09-04 11:09   ` Corentin Labbe
2020-09-04 11:10 ` [PATCH v6 15/18] crypto: sun8i-ce: Add support for the TRNG Corentin Labbe
2020-09-04 11:10   ` Corentin Labbe
2020-09-04 11:10 ` [PATCH v6 16/18] crypto: sun8i-ce: fix comparison of integer expressions of different signedness Corentin Labbe
2020-09-04 11:10   ` Corentin Labbe
2020-09-04 11:10 ` [PATCH v6 17/18] crypto: sun8i-ss: " Corentin Labbe
2020-09-04 11:10   ` Corentin Labbe
2020-09-04 11:10 ` [PATCH v6 18/18] crypto: sun8i-ce: fix some style issue Corentin Labbe
2020-09-04 11:10   ` Corentin Labbe
2020-09-04 19:37   ` Joe Perches
2020-09-04 19:37     ` Joe Perches
2020-09-07  7:16     ` [linux-sunxi] " Corentin Labbe
2020-09-07  7:16       ` Corentin Labbe
2020-09-07  7:18       ` Herbert Xu
2020-09-07  7:18         ` Herbert Xu

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=20200911063631.GA19560@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=clabbe@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=mripard@kernel.org \
    --cc=wens@csie.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 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.