Re: [PATCH] crypto: hisilicon/zip - Modify some data type and code cleanup

From: Herbert Xu
Date: Fri Feb 02 2024 - 04:49:21 EST


On Sat, Jan 27, 2024 at 02:08:50PM +0800, Chenghai Huang wrote:
> From: Yang Shen <shenyang39@xxxxxxxxxx>
>
> Improve some inappropriate variable types to make variable expression more
> accurate.
>
> Signed-off-by: Yang Shen <shenyang39@xxxxxxxxxx>
> Signed-off-by: Chenghai Huang <huangchenghai2@xxxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt