Commit 6d77282f authored by Herbert Xu's avatar Herbert Xu

crypto: n2 - Fix sparse endianness warning

This patch fixes sparse endianness warnings by changing the type
of hash_init to u8 from u32.  There should be no difference in the
generated code.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e61a2356
...@@ -249,7 +249,7 @@ static inline bool n2_should_run_async(struct spu_queue *qp, int this_len) ...@@ -249,7 +249,7 @@ static inline bool n2_should_run_async(struct spu_queue *qp, int this_len)
struct n2_ahash_alg { struct n2_ahash_alg {
struct list_head entry; struct list_head entry;
const u8 *hash_zero; const u8 *hash_zero;
const u32 *hash_init; const u8 *hash_init;
u8 hw_op_hashsz; u8 hw_op_hashsz;
u8 digest_size; u8 digest_size;
u8 auth_type; u8 auth_type;
...@@ -1225,7 +1225,7 @@ static LIST_HEAD(skcipher_algs); ...@@ -1225,7 +1225,7 @@ static LIST_HEAD(skcipher_algs);
struct n2_hash_tmpl { struct n2_hash_tmpl {
const char *name; const char *name;
const u8 *hash_zero; const u8 *hash_zero;
const u32 *hash_init; const u8 *hash_init;
u8 hw_op_hashsz; u8 hw_op_hashsz;
u8 digest_size; u8 digest_size;
u8 block_size; u8 block_size;
...@@ -1233,7 +1233,7 @@ struct n2_hash_tmpl { ...@@ -1233,7 +1233,7 @@ struct n2_hash_tmpl {
u8 hmac_type; u8 hmac_type;
}; };
static const u32 n2_md5_init[MD5_HASH_WORDS] = { static const __le32 n2_md5_init[MD5_HASH_WORDS] = {
cpu_to_le32(MD5_H0), cpu_to_le32(MD5_H0),
cpu_to_le32(MD5_H1), cpu_to_le32(MD5_H1),
cpu_to_le32(MD5_H2), cpu_to_le32(MD5_H2),
...@@ -1254,7 +1254,7 @@ static const u32 n2_sha224_init[SHA256_DIGEST_SIZE / 4] = { ...@@ -1254,7 +1254,7 @@ static const u32 n2_sha224_init[SHA256_DIGEST_SIZE / 4] = {
static const struct n2_hash_tmpl hash_tmpls[] = { static const struct n2_hash_tmpl hash_tmpls[] = {
{ .name = "md5", { .name = "md5",
.hash_zero = md5_zero_message_hash, .hash_zero = md5_zero_message_hash,
.hash_init = n2_md5_init, .hash_init = (u8 *)n2_md5_init,
.auth_type = AUTH_TYPE_MD5, .auth_type = AUTH_TYPE_MD5,
.hmac_type = AUTH_TYPE_HMAC_MD5, .hmac_type = AUTH_TYPE_HMAC_MD5,
.hw_op_hashsz = MD5_DIGEST_SIZE, .hw_op_hashsz = MD5_DIGEST_SIZE,
...@@ -1262,7 +1262,7 @@ static const struct n2_hash_tmpl hash_tmpls[] = { ...@@ -1262,7 +1262,7 @@ static const struct n2_hash_tmpl hash_tmpls[] = {
.block_size = MD5_HMAC_BLOCK_SIZE }, .block_size = MD5_HMAC_BLOCK_SIZE },
{ .name = "sha1", { .name = "sha1",
.hash_zero = sha1_zero_message_hash, .hash_zero = sha1_zero_message_hash,
.hash_init = n2_sha1_init, .hash_init = (u8 *)n2_sha1_init,
.auth_type = AUTH_TYPE_SHA1, .auth_type = AUTH_TYPE_SHA1,
.hmac_type = AUTH_TYPE_HMAC_SHA1, .hmac_type = AUTH_TYPE_HMAC_SHA1,
.hw_op_hashsz = SHA1_DIGEST_SIZE, .hw_op_hashsz = SHA1_DIGEST_SIZE,
...@@ -1270,7 +1270,7 @@ static const struct n2_hash_tmpl hash_tmpls[] = { ...@@ -1270,7 +1270,7 @@ static const struct n2_hash_tmpl hash_tmpls[] = {
.block_size = SHA1_BLOCK_SIZE }, .block_size = SHA1_BLOCK_SIZE },
{ .name = "sha256", { .name = "sha256",
.hash_zero = sha256_zero_message_hash, .hash_zero = sha256_zero_message_hash,
.hash_init = n2_sha256_init, .hash_init = (u8 *)n2_sha256_init,
.auth_type = AUTH_TYPE_SHA256, .auth_type = AUTH_TYPE_SHA256,
.hmac_type = AUTH_TYPE_HMAC_SHA256, .hmac_type = AUTH_TYPE_HMAC_SHA256,
.hw_op_hashsz = SHA256_DIGEST_SIZE, .hw_op_hashsz = SHA256_DIGEST_SIZE,
...@@ -1278,7 +1278,7 @@ static const struct n2_hash_tmpl hash_tmpls[] = { ...@@ -1278,7 +1278,7 @@ static const struct n2_hash_tmpl hash_tmpls[] = {
.block_size = SHA256_BLOCK_SIZE }, .block_size = SHA256_BLOCK_SIZE },
{ .name = "sha224", { .name = "sha224",
.hash_zero = sha224_zero_message_hash, .hash_zero = sha224_zero_message_hash,
.hash_init = n2_sha224_init, .hash_init = (u8 *)n2_sha224_init,
.auth_type = AUTH_TYPE_SHA256, .auth_type = AUTH_TYPE_SHA256,
.hmac_type = AUTH_TYPE_RESERVED, .hmac_type = AUTH_TYPE_RESERVED,
.hw_op_hashsz = SHA256_DIGEST_SIZE, .hw_op_hashsz = SHA256_DIGEST_SIZE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment