Skip to contentSkip to conversation

crypto: img-hash - fix some compile warnings

PATCH In review Dan Carpenter 2 participants 2 messages Mar 20, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 crypto: img-hash - fix some compile warnings

GCC complains about that %u is the wrong format string for size_t and also that "ret" is unused.

drivers/crypto/img-hash.c +1 -2
index fec61fc..601ab35 100644
@@ -192,7 +192,7 @@ static int img_hash_xmit_cpu(struct img_hash_dev *hdev, const u8 *buf,
 	u32 count, len32;
 	const u32 *buffer = (const u32 *)buf;
 
-	dev_dbg(hdev->dev, "xmit_cpu:  length: %u bytes\n", length);
+	dev_dbg(hdev->dev, "xmit_cpu:  length: %zu bytes\n", length);
 
 	if (final)
 		hdev->flags |= DRIVER_FLAGS_FINAL;
@@ -459,7 +459,6 @@ static int img_hash_hw_init(struct img_hash_dev *hdev)
 {
 	unsigned long long nbits;
 	u32 u, l;
-	int ret;
 
 	img_hash_write(hdev, CR_RESET, CR_RESET_SET);
 	img_hash_write(hdev, CR_RESET, CR_RESET_UNSET);
#1 lore raw

Hi Dan,

Thanks for the patch.

James.

Quoted 35 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: 20 March 2015 14:21
To: Herbert Xu; James Hartley
Cc: David S. Miller; [email protected]; kernel- [email protected]
Subject: [patch 1/2] crypto: img-hash - fix some compile warnings

GCC complains about that %u is the wrong format string for size_t and also that "ret" is unused.

drivers/crypto/img-hash.c index renamed from drivers/crypto/img-hash.c +0 -0

fec61fc..601ab35 100644

drivers/crypto/img-hash.c +1 -1
@@ -192,7 +192,7 @@ static int img_hash_xmit_cpu(struct img_hash_dev
 *hdev, const u8 *buf,
 	u32 count, len32;
 	const u32 *buffer = (const u32 *)buf;
 
-	dev_dbg(hdev->dev, "xmit_cpu:  length: %u bytes\n", length);
+	dev_dbg(hdev->dev, "xmit_cpu:  length: %zu bytes\n", length);
 
 	if (final)
drivers/crypto/img-hash.c +0 -1
 		hdev->flags |= DRIVER_FLAGS_FINAL;
@@ -459,7 +459,6 @@ static int img_hash_hw_init(struct img_hash_dev
 *hdev)  {
 	unsigned long long nbits;
 	u32 u, l;
-	int ret;
 
 	img_hash_write(hdev, CR_RESET, CR_RESET_SET);
 	img_hash_write(hdev, CR_RESET, CR_RESET_UNSET);