Hi,

I found this warning using the command "make coccicheck 
COCCI=scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci MODE=patch" 

Best

-----邮件原件-----
发件人: Gilad Ben-Yossef [mailto:gi...@benyossef.com] 
发送时间: 2019年10月2日 18:00
收件人: tiantao (H) <tiant...@huawei.com>
抄送: Herbert Xu <herb...@gondor.apana.org.au>; David Miller 
<da...@davemloft.net>; Linux Crypto Mailing List 
<linux-crypto@vger.kernel.org>; Linuxarm <linux...@huawei.com>
主题: Re: [PATCH] crypto: fix comparison of unsigned expression warnings

Hi,


On Mon, Sep 30, 2019 at 11:52 AM Tian Tao <tiant...@huawei.com> wrote:
>
> This patch fixes the following warnings:
> drivers/crypto/ccree/cc_aead.c:630:5-12: WARNING: Unsigned expression 
> compared with zero: seq_len > 0
>

Thanks for the report!

Can you please share which compiler/arch/config you use that produces this 
warning?

I'm not seeing it on my end.

Many thanks,
Gilad

> Signed-off-by: Tian Tao <tiant...@huawei.com>
> ---
>  drivers/crypto/ccree/cc_aead.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/ccree/cc_aead.c 
> b/drivers/crypto/ccree/cc_aead.c index d3e8faa..b19291d 100644
> --- a/drivers/crypto/ccree/cc_aead.c
> +++ b/drivers/crypto/ccree/cc_aead.c
> @@ -546,7 +546,7 @@ static int cc_aead_setkey(struct crypto_aead *tfm, const 
> u8 *key,
>         struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm);
>         struct cc_crypto_req cc_req = {};
>         struct cc_hw_desc desc[MAX_AEAD_SETKEY_SEQ];
> -       unsigned int seq_len = 0;
> +       int seq_len = 0;
>         struct device *dev = drvdata_to_dev(ctx->drvdata);
>         const u8 *enckey, *authkey;
>         int rc;
> --
> 2.7.4
>


--
Gilad Ben-Yossef
Chief Coffee Drinker

values of β will give rise to dom!

Reply via email to