All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] crypto: correct the use of print format
@ 2021-04-08 10:23 Kai Ye
  2021-04-08 10:23 ` [PATCH 1/2] crypto/atmel - use the correct " Kai Ye
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kai Ye @ 2021-04-08 10:23 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, linux-kernel, yekai13

According to Documentation/core-api/printk-formats.rst,
Use the correct print format. Printing an unsigned int value should use %u
instead of %d. Otherwise printk() might end up displaying negative numbers.

Kai Ye (2):
  crypto/atmel - use the correct print format
  crypto: hisilicon/sec_drv - use the correct print format

 drivers/crypto/atmel-i2c.c             | 2 +-
 drivers/crypto/atmel-sha.c             | 4 ++--
 drivers/crypto/hisilicon/sec/sec_drv.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.8.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] crypto/atmel - use the correct print format
  2021-04-08 10:23 [PATCH 0/2] crypto: correct the use of print format Kai Ye
@ 2021-04-08 10:23 ` Kai Ye
  2021-04-08 10:23 ` [PATCH 2/2] crypto: hisilicon/sec_drv " Kai Ye
  2021-04-16 11:31 ` [PATCH 0/2] crypto: correct the use of " Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Ye @ 2021-04-08 10:23 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, linux-kernel, yekai13

According to Documentation/core-api/printk-formats.rst, Use
the correct print format. Printing an unsigned int value should use %u
instead of %d.

Signed-off-by: Kai Ye <yekai13@huawei.com>
---
 drivers/crypto/atmel-i2c.c | 2 +-
 drivers/crypto/atmel-sha.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/atmel-i2c.c b/drivers/crypto/atmel-i2c.c
index e8e8281..6fd3e96 100644
--- a/drivers/crypto/atmel-i2c.c
+++ b/drivers/crypto/atmel-i2c.c
@@ -339,7 +339,7 @@ int atmel_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	}
 
 	if (bus_clk_rate > 1000000L) {
-		dev_err(dev, "%d exceeds maximum supported clock frequency (1MHz)\n",
+		dev_err(dev, "%u exceeds maximum supported clock frequency (1MHz)\n",
 			bus_clk_rate);
 		return -EINVAL;
 	}
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 352d80c..1b13f60 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -434,7 +434,7 @@ static int atmel_sha_init(struct ahash_request *req)
 
 	ctx->flags = 0;
 
-	dev_dbg(dd->dev, "init: digest size: %d\n",
+	dev_dbg(dd->dev, "init: digest size: %u\n",
 		crypto_ahash_digestsize(tfm));
 
 	switch (crypto_ahash_digestsize(tfm)) {
@@ -1102,7 +1102,7 @@ static int atmel_sha_start(struct atmel_sha_dev *dd)
 	struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
 	int err;
 
-	dev_dbg(dd->dev, "handling new req, op: %lu, nbytes: %d\n",
+	dev_dbg(dd->dev, "handling new req, op: %lu, nbytes: %u\n",
 						ctx->op, req->nbytes);
 
 	err = atmel_sha_hw_init(dd);
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] crypto: hisilicon/sec_drv - use the correct print format
  2021-04-08 10:23 [PATCH 0/2] crypto: correct the use of print format Kai Ye
  2021-04-08 10:23 ` [PATCH 1/2] crypto/atmel - use the correct " Kai Ye
@ 2021-04-08 10:23 ` Kai Ye
  2021-04-16 11:31 ` [PATCH 0/2] crypto: correct the use of " Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Ye @ 2021-04-08 10:23 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, linux-kernel, yekai13

According to Documentation/core-api/printk-formats.rst, Use
the correct print format. Printing an unsigned int value should use %u
instead of %d.

Signed-off-by: Kai Ye <yekai13@huawei.com>
---
 drivers/crypto/hisilicon/sec/sec_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/hisilicon/sec/sec_drv.c b/drivers/crypto/hisilicon/sec/sec_drv.c
index 91ee2bb..819bbb5 100644
--- a/drivers/crypto/hisilicon/sec/sec_drv.c
+++ b/drivers/crypto/hisilicon/sec/sec_drv.c
@@ -233,7 +233,7 @@ static int sec_queue_map_io(struct sec_queue *queue)
 				    IORESOURCE_MEM,
 				    2 + queue->queue_id);
 	if (!res) {
-		dev_err(dev, "Failed to get queue %d memory resource\n",
+		dev_err(dev, "Failed to get queue %u memory resource\n",
 			queue->queue_id);
 		return -ENOMEM;
 	}
@@ -653,12 +653,12 @@ static int sec_queue_free(struct sec_queue *queue)
 	struct sec_dev_info *info = queue->dev_info;
 
 	if (queue->queue_id >= SEC_Q_NUM) {
-		dev_err(info->dev, "No queue %d\n", queue->queue_id);
+		dev_err(info->dev, "No queue %u\n", queue->queue_id);
 		return -ENODEV;
 	}
 
 	if (!queue->in_use) {
-		dev_err(info->dev, "Queue %d is idle\n", queue->queue_id);
+		dev_err(info->dev, "Queue %u is idle\n", queue->queue_id);
 		return -ENODEV;
 	}
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] crypto: correct the use of print format
  2021-04-08 10:23 [PATCH 0/2] crypto: correct the use of print format Kai Ye
  2021-04-08 10:23 ` [PATCH 1/2] crypto/atmel - use the correct " Kai Ye
  2021-04-08 10:23 ` [PATCH 2/2] crypto: hisilicon/sec_drv " Kai Ye
@ 2021-04-16 11:31 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2021-04-16 11:31 UTC (permalink / raw)
  To: Kai Ye; +Cc: linux-crypto, linux-kernel

On Thu, Apr 08, 2021 at 06:23:49PM +0800, Kai Ye wrote:
> According to Documentation/core-api/printk-formats.rst,
> Use the correct print format. Printing an unsigned int value should use %u
> instead of %d. Otherwise printk() might end up displaying negative numbers.
> 
> Kai Ye (2):
>   crypto/atmel - use the correct print format
>   crypto: hisilicon/sec_drv - use the correct print format
> 
>  drivers/crypto/atmel-i2c.c             | 2 +-
>  drivers/crypto/atmel-sha.c             | 4 ++--
>  drivers/crypto/hisilicon/sec/sec_drv.c | 6 +++---
>  3 files changed, 6 insertions(+), 6 deletions(-)

All 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-16 11:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 10:23 [PATCH 0/2] crypto: correct the use of print format Kai Ye
2021-04-08 10:23 ` [PATCH 1/2] crypto/atmel - use the correct " Kai Ye
2021-04-08 10:23 ` [PATCH 2/2] crypto: hisilicon/sec_drv " Kai Ye
2021-04-16 11:31 ` [PATCH 0/2] crypto: correct the use of " Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.