Skip to contentSkip to conversation

crypto: caam: fix type mismatch warning

PATCH In review Arnd Bergmann 3 participants 3 messages Oct 25, 2016 – Nov 1, 2016

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

PATCH 1/1 crypto: caam: fix type mismatch warning

Building the caam driver on arm64 produces a harmless warning:

drivers/crypto/caam/caamalg.c:140:139: warning: comparison of distinct pointer types lacks a cast

We can use min_t to tell the compiler which type we want it to use here.

Fixes 5ecf8ef9103c ("crypto: caam - fix sg dump")

---
This is currently the only warning reported by kernelci.org for linux-4.9 on arm, arm64 and x86.

---
 drivers/crypto/caam/caamalg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/caam/caamalg.c +1 -1
index 156aad167cd6..8de85dfb1b04 100644
@@ -137,7 +137,7 @@ static void dbg_dump_sg(const char *level, const char *prefix_str,
 		}
 
 		buf = it_page + it->offset;
-		len = min(tlen, it->length);
+		len = min_t(size_t, tlen, it->length);
 		print_hex_dump(level, prefix_str, prefix_type, rowsize,
 			       groupsize, buf, len, ascii);
 		tlen -= len;
Signature · 1 line
2.9.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Arnd Bergmann

Building the caam driver on arm64 produces a harmless warning:

drivers/crypto/caam/caamalg.c:140:139: warning: comparison of distinct pointer types lacks a cast

We can use min_t to tell the compiler which type we want it to use here.

Fixes 5ecf8ef9103c ("crypto: caam - fix sg dump")

Thanks,
Horia

maintainer
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

Building the caam driver on arm64 produces a harmless warning:

drivers/crypto/caam/caamalg.c:140:139: warning: comparison of distinct pointer types lacks a cast

We can use min_t to tell the compiler which type we want it to use here.

Fixes 5ecf8ef9103c ("crypto: caam - fix sg dump")

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt