[CRYPTO] rmd: Use pointer form of endian swapping operations
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / crypto / rmd256.c
index 88f2203751ae2d7d11cd6e6e15b3f89a5ec3a109..b08852690706f9de97a4916b4edb60f5eed194a2 100644 (file)
@@ -44,7 +44,7 @@ struct rmd256_ctx {
 #define F4(x, y, z) (y ^ (z & (x ^ y)))        /* z ? x : y */
 
 #define ROUND(a, b, c, d, f, k, x, s)  { \
-       (a) += f((b), (c), (d)) + le32_to_cpu(x) + (k); \
+       (a) += f((b), (c), (d)) + le32_to_cpup(&(x)) + (k); \
        (a) = rol32((a), (s)); \
 }
 
@@ -304,7 +304,7 @@ static void rmd256_final(struct crypto_tfm *tfm, u8 *out)
 
        /* Store state in digest */
        for (i = 0; i < 8; i++)
-               dst[i] = cpu_to_le32(rctx->state[i]);
+               dst[i] = cpu_to_le32p(&rctx->state[i]);
 
        /* Wipe context */
        memset(rctx, 0, sizeof(*rctx));