[03/11] crypto: streebog - use correct endianness type
diff mbox series

Message ID 20190110201802.82442-4-ebiggers@kernel.org
State Accepted
Delegated to: Herbert Xu
Headers show
Series
  • crypto: misc fixes/cleanups
Related show

Commit Message

Eric Biggers Jan. 10, 2019, 8:17 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

streebog_uint512::qword needs to be __le64, not u64.  This fixes a large
number of sparse warnings:

    crypto/streebog_generic.c:25:9: warning: incorrect type in initializer (different base types)
    crypto/streebog_generic.c:25:9:    expected unsigned long long
    crypto/streebog_generic.c:25:9:    got restricted __le64 [usertype]
    [omitted many similar warnings]

No actual change in behavior.

Cc: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 crypto/streebog_generic.c | 2 +-
 include/crypto/streebog.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/crypto/streebog_generic.c b/crypto/streebog_generic.c
index 03272a22afcec..5a2eafed9c29f 100644
--- a/crypto/streebog_generic.c
+++ b/crypto/streebog_generic.c
@@ -960,7 +960,7 @@  static int streebog_init(struct shash_desc *desc)
 	memset(ctx, 0, sizeof(struct streebog_state));
 	for (i = 0; i < 8; i++) {
 		if (digest_size == STREEBOG256_DIGEST_SIZE)
-			ctx->h.qword[i] = 0x0101010101010101ULL;
+			ctx->h.qword[i] = cpu_to_le64(0x0101010101010101ULL);
 	}
 	return 0;
 }
diff --git a/include/crypto/streebog.h b/include/crypto/streebog.h
index 4af119f7e07b9..856e32af86574 100644
--- a/include/crypto/streebog.h
+++ b/include/crypto/streebog.h
@@ -19,7 +19,7 @@ 
 #define STREEBOG_BLOCK_SIZE	64
 
 struct streebog_uint512 {
-	u64 qword[8];
+	__le64 qword[8];
 };
 
 struct streebog_state {