From: Antoine Ténart Date: Thu, 1 Jun 2017 19:38:59 +0000 (+0200) Subject: crypto: sun4i-ss - simplify the appended bit assignment X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=303391d69b6ae7dff30f7886b717e39f47067d6d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git crypto: sun4i-ss - simplify the appended bit assignment A bit is appended at the end of the input buffer for sha1. Simplify the code assigning it. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c index 59d9b4412aca..0c2efc88bc0a 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c @@ -392,12 +392,8 @@ hash_final: } /* write the remaining bytes of the nbw buffer */ - if (nbw) { - wb |= ((1 << 7) << (nbw * 8)); - bf[j++] = wb; - } else { - bf[j++] = 1 << 7; - } + wb |= ((1 << 7) << (nbw * 8)); + bf[j++] = wb; /* * number of space to pad to obtain 64o minus 8(size) minus 4 (final 1)