Commit 7c2f5537 authored by Herbert Xu's avatar Herbert Xu

crypto: mips/octeon - Fix sparse endianness warnings

This patch fixes a number of endianness warnings in the mips/octeon
code.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent da6d5794
...@@ -41,7 +41,7 @@ do { \ ...@@ -41,7 +41,7 @@ do { \
*/ */
#define read_octeon_64bit_hash_dword(index) \ #define read_octeon_64bit_hash_dword(index) \
({ \ ({ \
u64 __value; \ __be64 __value; \
\ \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"dmfc2 %[rt],0x0048+" STR(index) \ "dmfc2 %[rt],0x0048+" STR(index) \
......
...@@ -68,10 +68,11 @@ static int octeon_md5_init(struct shash_desc *desc) ...@@ -68,10 +68,11 @@ static int octeon_md5_init(struct shash_desc *desc)
{ {
struct md5_state *mctx = shash_desc_ctx(desc); struct md5_state *mctx = shash_desc_ctx(desc);
mctx->hash[0] = cpu_to_le32(MD5_H0); mctx->hash[0] = MD5_H0;
mctx->hash[1] = cpu_to_le32(MD5_H1); mctx->hash[1] = MD5_H1;
mctx->hash[2] = cpu_to_le32(MD5_H2); mctx->hash[2] = MD5_H2;
mctx->hash[3] = cpu_to_le32(MD5_H3); mctx->hash[3] = MD5_H3;
cpu_to_le32_array(mctx->hash, 4);
mctx->byte_count = 0; mctx->byte_count = 0;
return 0; return 0;
...@@ -139,8 +140,9 @@ static int octeon_md5_final(struct shash_desc *desc, u8 *out) ...@@ -139,8 +140,9 @@ static int octeon_md5_final(struct shash_desc *desc, u8 *out)
} }
memset(p, 0, padding); memset(p, 0, padding);
mctx->block[14] = cpu_to_le32(mctx->byte_count << 3); mctx->block[14] = mctx->byte_count << 3;
mctx->block[15] = cpu_to_le32(mctx->byte_count >> 29); mctx->block[15] = mctx->byte_count >> 29;
cpu_to_le32_array(mctx->block + 14, 2);
octeon_md5_transform(mctx->block); octeon_md5_transform(mctx->block);
octeon_md5_read_hash(mctx); octeon_md5_read_hash(mctx);
......
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