[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 2 Feb 2024 17:49:01 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Chenghai Huang <huangchenghai2@...wei.com>
Cc: davem@...emloft.net, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org, shenyang39@...wei.com
Subject: Re: [PATCH] crypto: hisilicon/zip - Modify some data type and code
cleanup
On Sat, Jan 27, 2024 at 02:08:50PM +0800, Chenghai Huang wrote:
> From: Yang Shen <shenyang39@...wei.com>
>
> Improve some inappropriate variable types to make variable expression more
> accurate.
>
> Signed-off-by: Yang Shen <shenyang39@...wei.com>
> Signed-off-by: Chenghai Huang <huangchenghai2@...wei.com>
> ---
> drivers/crypto/hisilicon/zip/zip_main.c | 29 +++++++++++--------------
> 1 file changed, 13 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c
> index 479ba8a1d6b5..b3e2b58ba7d7 100644
> --- a/drivers/crypto/hisilicon/zip/zip_main.c
> +++ b/drivers/crypto/hisilicon/zip/zip_main.c
> @@ -809,21 +809,20 @@ DEFINE_SHOW_ATTRIBUTE(hisi_zip_regs);
>
> static int hisi_zip_core_debug_init(struct hisi_qm *qm)
> {
> - u32 zip_core_num, zip_comp_core_num;
> + u32 zip_core_num, zip_comp_core_num, i;
> struct device *dev = &qm->pdev->dev;
> struct debugfs_regset32 *regset;
> struct dentry *tmp_d;
> char buf[HZIP_BUF_SIZE];
> - int i;
>
> zip_core_num = qm->cap_tables.dev_cap_table[ZIP_CORE_NUM_CAP_IDX].cap_val;
> zip_comp_core_num = qm->cap_tables.dev_cap_table[ZIP_CLUSTER_COMP_NUM_CAP_IDX].cap_val;
>
> for (i = 0; i < zip_core_num; i++) {
> if (i < zip_comp_core_num)
> - scnprintf(buf, sizeof(buf), "comp_core%d", i);
> + scnprintf(buf, sizeof(buf), "comp_core%u", i);
> else
> - scnprintf(buf, sizeof(buf), "decomp_core%d",
> + scnprintf(buf, sizeof(buf), "decomp_core%u",
> i - zip_comp_core_num);
>
> regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL);
What issues does this patch fix? This change appears to be
gratuitous.
Cheers,
--
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