All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Yue Haibing <yuehaibing@huawei.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCH -next] crypto: ccree - remove set but not used variable 'du_size'
Date: Sun, 28 Apr 2019 10:58:43 +0300	[thread overview]
Message-ID: <CAOtvUMesBDrnMd=d5S50xj0W2PyYbb9E9SeYvaev4Dw7Uu_tHg@mail.gmail.com> (raw)
In-Reply-To: <20190426151821.36944-1-yuehaibing@huawei.com>

On Fri, Apr 26, 2019 at 7:38 PM Yue Haibing <yuehaibing@huawei.com> wrote:
>
> From: YueHaibing <yuehaibing@huawei.com>
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/crypto/ccree/cc_cipher.c: In function cc_setup_key_desc:
> drivers/crypto/ccree/cc_cipher.c:645:15: warning: variable du_size set but not used [-Wunused-but-set-variable]
>
> It is never used since introduction in
> commit dd8486c75085 ("crypto: ccree - move key load desc. before flow desc.")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/ccree/cc_cipher.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c
> index d9f8cd5..6bd3791 100644
> --- a/drivers/crypto/ccree/cc_cipher.c
> +++ b/drivers/crypto/ccree/cc_cipher.c
> @@ -642,16 +642,12 @@ static void cc_setup_key_desc(struct crypto_tfm *tfm,
>         int direction = req_ctx->gen_ctx.op_type;
>         dma_addr_t key_dma_addr = ctx_p->user.key_dma_addr;
>         unsigned int key_len = ctx_p->keylen;
> -       unsigned int du_size = nbytes;
>         unsigned int din_size;
>
>         struct cc_crypto_alg *cc_alg =
>                 container_of(tfm->__crt_alg, struct cc_crypto_alg,
>                              skcipher_alg.base);
>
> -       if (cc_alg->data_unit)
> -               du_size = cc_alg->data_unit;

Thanks!
This is a good catch. It seems we can also drop the whole cc_alg var
as well in this case,
since it is only used by the code setting du_size....

Do you want to send a patch doing both or shall I ?

Cheers,
Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

values of β will give rise to dom!

  reply	other threads:[~2019-04-28  7:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-26 15:18 [PATCH -next] crypto: ccree - remove set but not used variable 'du_size' Yue Haibing
2019-04-28  7:58 ` Gilad Ben-Yossef [this message]
2019-04-28  8:16   ` YueHaibing
2019-04-28  8:28 ` [PATCH v2 " Yue Haibing
2019-05-03  6:11   ` Herbert Xu
2020-02-03 15:39 [PATCH " YueHaibing
2020-02-03 15:39 ` YueHaibing
2020-02-03 15:39 ` YueHaibing
2020-02-13  9:22 ` Herbert Xu
2020-02-13  9:22   ` Herbert Xu
2020-02-13  9:22   ` 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='CAOtvUMesBDrnMd=d5S50xj0W2PyYbb9E9SeYvaev4Dw7Uu_tHg@mail.gmail.com' \
    --to=gilad@benyossef.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /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.