[PATCH] hwrng: stm32 - use sizeof(*priv) instead of sizeof(struct stm32_rng_private)

Marek Vasut marex at denx.de
Fri May 31 01:57:34 PDT 2024


Use sizeof(*priv) instead of sizeof(struct stm32_rng_private), the
former makes renaming of struct stm32_rng_private easier if necessary,
as it removes one site where such rename has to happen. No functional
change.

Signed-off-by: Marek Vasut <marex at denx.de>
---
Cc: "Uwe Kleine-König" <u.kleine-koenig at pengutronix.de>
Cc: Alexandre Torgue <alexandre.torgue at foss.st.com>
Cc: Gatien Chevallier <gatien.chevallier at foss.st.com>
Cc: Herbert Xu <herbert at gondor.apana.org.au>
Cc: Marek Vasut <marex at denx.de>
Cc: Maxime Coquelin <mcoquelin.stm32 at gmail.com>
Cc: Olivia Mackall <olivia at selenic.com>
Cc: Rob Herring <robh at kernel.org>
Cc: Yang Yingliang <yangyingliang at huawei.com>
Cc: kernel at dh-electronics.com
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-crypto at vger.kernel.org
Cc: linux-stm32 at st-md-mailman.stormreply.com
---
 drivers/char/hw_random/stm32-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index d08c870eb8d1f..9d041a67c295a 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -517,7 +517,7 @@ static int stm32_rng_probe(struct platform_device *ofdev)
 	struct stm32_rng_private *priv;
 	struct resource *res;
 
-	priv = devm_kzalloc(dev, sizeof(struct stm32_rng_private), GFP_KERNEL);
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-- 
2.43.0




More information about the linux-arm-kernel mailing list