Subject: Re: linux-next / s390 crypto breakage

From: Jan Glauber <[email-masked]>
Date: Wed, 02 Sep 2009 17:57:25 +0000

That patch should fix the warnings.

--Jan

diff --git a/arch/s390/crypto/sha1_s390.c b/arch/s390/crypto/sha1_s390.c
index 4a94378..f6de782 100644
--- a/arch/s390/crypto/sha1_s390.c
+++ b/arch/s390/crypto/sha1_s390.c
@@ -57,10 +57,10 @@ static int sha1_export(struct shash_desc *desc, void *out)
 	return 0;
 }
 
-static int sha1_import(struct shash_desc *desc, const u8 *in)
+static int sha1_import(struct shash_desc *desc, const void *in)
 {
 	struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
-	struct sha1_state *ictx = in;
+	const struct sha1_state *ictx = in;
 
 	sctx->count = ictx->count;
 	memcpy(sctx->state, ictx->state, sizeof(ictx->state));
diff --git a/arch/s390/crypto/sha256_s390.c b/arch/s390/crypto/sha256_s390.c
index 2bab519..61a7db3 100644
--- a/arch/s390/crypto/sha256_s390.c
+++ b/arch/s390/crypto/sha256_s390.c
@@ -53,10 +53,10 @@ static int sha256_export(struct shash_desc *desc, void *out)
 	return 0;
 }
 
-static int sha256_import(struct shash_desc *desc, const u8 *in)
+static int sha256_import(struct shash_desc *desc, const void *in)
 {
 	struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
-	struct sha256_state *ictx = in;
+	const struct sha256_state *ictx = in;
 
 	sctx->count = ictx->count;
 	memcpy(sctx->state, ictx->state, sizeof(ictx->state));
diff --git a/arch/s390/crypto/sha512_s390.c b/arch/s390/crypto/sha512_s390.c
index b4b3438..4bf73d0 100644
--- a/arch/s390/crypto/sha512_s390.c
+++ b/arch/s390/crypto/sha512_s390.c
@@ -52,10 +52,10 @@ static int sha512_export(struct shash_desc *desc, void *out)
 	return 0;
 }
 
-static int sha512_import(struct shash_desc *desc, const u8 *in)
+static int sha512_import(struct shash_desc *desc, const void *in)
 {
 	struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
-	struct sha512_state *ictx = in;
+	const struct sha512_state *ictx = in;
 
 	if (unlikely(ictx->count[1]))
 		return -ERANGE;

On Wed, 2009-09-02 at 13:35 +0200, Heiko Carstens wrote:
> Hi Herbert,
> 
> your patch "crypto: shash - Export/import hash state only" causes this
> on s390:
> 
>   CC      arch/s390/crypto/sha1_s390.o
> arch/s390/crypto/sha1_s390.c: In function 'sha1_import':
> arch/s390/crypto/sha1_s390.c:63: warning: initialization from incompatible pointer type
> arch/s390/crypto/sha1_s390.c: At top level:
> arch/s390/crypto/sha1_s390.c:78: warning: initialization from incompatible pointer type
>   CC      arch/s390/crypto/sha_common.o
>   CC      arch/s390/crypto/sha256_s390.o
> arch/s390/crypto/sha256_s390.c: In function 'sha256_import':
> arch/s390/crypto/sha256_s390.c:59: warning: initialization from incompatible pointer type
> arch/s390/crypto/sha256_s390.c: At top level:
> arch/s390/crypto/sha256_s390.c:74: warning: initialization from incompatible pointer type
>   CC      arch/s390/crypto/sha512_s390.o
> arch/s390/crypto/sha512_s390.c: In function 'sha512_import':
> arch/s390/crypto/sha512_s390.c:58: warning: initialization from incompatible pointer type
> arch/s390/crypto/sha512_s390.c: At top level:
> arch/s390/crypto/sha512_s390.c:76: warning: initialization from incompatible pointer type
> arch/s390/crypto/sha512_s390.c:115: warning: initialization from incompatible pointer type
> 
> Looks like you missed some conversions. Could you (or Jan?) fix this please?
> 
> Thanks!