Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Ethan Carter Edwards <ethan@ethancedwards.com>
To: Weili Qian <qianweili@huawei.com>,
	Zhou Wang <wangzhou1@hisilicon.com>,
	 Herbert Xu <herbert@gondor.apana.org.au>,
	 "David S. Miller" <davem@davemloft.net>,
	 "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-hardening@vger.kernel.org,
	 Ethan Carter Edwards <ethan@ethancedwards.com>
Subject: [PATCH 1/2] crypto: hisilicon/qm - remove sizeof(char)
Date: Sat, 03 May 2025 16:21:27 -0400	[thread overview]
Message-ID: <20250503-hisilicon_qm-v1-1-d4ebc242bc8a@ethancedwards.com> (raw)
In-Reply-To: <20250503-hisilicon_qm-v1-0-d4ebc242bc8a@ethancedwards.com>

`sizeof(char)` evaluates to 1. Remove the churn.

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
---
 drivers/crypto/hisilicon/qm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index d3f5d108b898bb5fa6ef901070e9e97b02afb29a..80d57f0dbf26e2902e01103b0a705234009161ee 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -862,7 +862,7 @@ int hisi_qm_set_algs(struct hisi_qm *qm, u64 alg_msk, const struct qm_dev_alg *d
 		return -EINVAL;
 	}
 
-	algs = devm_kzalloc(dev, QM_DEV_ALG_MAX_LEN * sizeof(char), GFP_KERNEL);
+	algs = devm_kzalloc(dev, QM_DEV_ALG_MAX_LEN, GFP_KERNEL);
 	if (!algs)
 		return -ENOMEM;
 

-- 
2.48.1


  reply	other threads:[~2025-05-03 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-03 20:21 [PATCH 0/2] crypto: hisilicon/qm - memory allocation cleanups Ethan Carter Edwards
2025-05-03 20:21 ` Ethan Carter Edwards [this message]
2025-05-03 20:21 ` [PATCH 2/2] crypto: hisilicon/qm - replace devm_kzalloc with devm_kcalloc Ethan Carter Edwards
2025-05-05 12:28 ` [PATCH 0/2] crypto: hisilicon/qm - memory allocation cleanups 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=20250503-hisilicon_qm-v1-1-d4ebc242bc8a@ethancedwards.com \
    --to=ethan@ethancedwards.com \
    --cc=davem@davemloft.net \
    --cc=gustavoars@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qianweili@huawei.com \
    --cc=wangzhou1@hisilicon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox