lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64caed2a-fafe-040d-c967-5eebaf6b144d@infradead.org>
Date:   Sun, 4 Sep 2022 20:36:24 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Neal Liu <neal_liu@...eedtech.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>,
        Joel Stanley <joel@....id.au>, Andrew Jeffery <andrew@...id.au>
Cc:     linux-aspeed@...ts.ozlabs.org, linux-crypto@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        BMC-SW@...eedtech.com, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] crypto: aspeed: fix format unexpected build warning



On 9/4/22 20:28, Neal Liu wrote:
> This fixes the following similar build warning when
> enabling compile test:
> 
> aspeed-hace-hash.c:188:9: warning: format '%x' expects argument of type
> 'unsigned int', but argument 7 has type 'size_t' {aka 'long unsigned int'}
> [-Wformat=]
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Neal Liu <neal_liu@...eedtech.com>
> ---
>  drivers/crypto/aspeed/aspeed-hace-hash.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/aspeed/aspeed-hace-hash.c b/drivers/crypto/aspeed/aspeed-hace-hash.c
> index 0a44ffc0e13b..d0f61149fe24 100644
> --- a/drivers/crypto/aspeed/aspeed-hace-hash.c
> +++ b/drivers/crypto/aspeed/aspeed-hace-hash.c
> @@ -186,7 +186,7 @@ static int aspeed_ahash_dma_prepare_sg(struct aspeed_hace_dev *hace_dev)
>  	length = rctx->total + rctx->bufcnt - remain;
>  
>  	AHASH_DBG(hace_dev, "%s:0x%x, %s:0x%x, %s:0x%x, %s:0x%x\n",
> -		  "rctx total", rctx->total, "bufcnt", rctx->bufcnt,
> +		  "rctx total", rctx->total, "bufcnt", (u32)rctx->bufcnt,
>  		  "length", length, "remain", remain);
>  
>  	sg_len = dma_map_sg(hace_dev->dev, rctx->src_sg, rctx->src_nents,
> @@ -325,8 +325,8 @@ static int aspeed_hace_ahash_trigger(struct aspeed_hace_dev *hace_dev,
>  	struct aspeed_sham_reqctx *rctx = ahash_request_ctx(req);
>  
>  	AHASH_DBG(hace_dev, "src_dma:0x%x, digest_dma:0x%x, length:0x%x\n",
> -		  hash_engine->src_dma, hash_engine->digest_dma,
> -		  hash_engine->src_length);
> +		  (u32)hash_engine->src_dma, (u32)hash_engine->digest_dma,
> +		  (u32)hash_engine->src_length);
>  
>  	rctx->cmd |= HASH_CMD_INT_ENABLE;
>  	hash_engine->resume = resume;

No, size_t values should be printed with %zu.
No cast needed.

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ