[PATCH v1] hwrng: histb-rng: Fix the wrong format specifier

Zhu Jun posted 1 patch 1 month, 2 weeks ago
drivers/char/hw_random/histb-rng.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v1] hwrng: histb-rng: Fix the wrong format specifier
Posted by Zhu Jun 1 month, 2 weeks ago
The format specifier of "unsigned int" in sprintf() should be "%u", not
"%d".

Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
Changes:
v1:fix the subject line, it has to be in the subsystem style

 drivers/char/hw_random/histb-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/histb-rng.c b/drivers/char/hw_random/histb-rng.c
index f652e1135e4b..1b91e88cc4c0 100644
--- a/drivers/char/hw_random/histb-rng.c
+++ b/drivers/char/hw_random/histb-rng.c
@@ -89,7 +89,7 @@ depth_show(struct device *dev, struct device_attribute *attr, char *buf)
 	struct histb_rng_priv *priv = dev_get_drvdata(dev);
 	void __iomem *base = priv->base;
 
-	return sprintf(buf, "%d\n", histb_rng_get_depth(base));
+	return sprintf(buf, "%u\n", histb_rng_get_depth(base));
 }
 
 static ssize_t
-- 
2.17.1
Re: [PATCH v1] hwrng: histb-rng: Fix the wrong format specifier
Posted by Herbert Xu 1 month, 1 week ago
On Tue, Oct 08, 2024 at 11:42:44PM -0700, Zhu Jun wrote:
> The format specifier of "unsigned int" in sprintf() should be "%u", not
> "%d".
> 
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> ---
> Changes:
> v1:fix the subject line, it has to be in the subsystem style
> 
>  drivers/char/hw_random/histb-rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt