summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/sunxi-ss
diff options
context:
space:
mode:
authorAntoine Ténart <antoine.tenart@free-electrons.com>2017-06-01 21:38:55 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2017-06-19 14:19:49 +0800
commit11be0107ab1a893121ff31325e1bf82d843ea4dc (patch)
tree09f1bb299d1e0eed8e067d2da696e1b55bc401db /drivers/crypto/sunxi-ss
parenta595e60a70c0d035b5a088f90ae3fde475c7e755 (diff)
downloadlinux-11be0107ab1a893121ff31325e1bf82d843ea4dc.tar.bz2
crypto: sun4i-ss - use lower/upper_32_bits helpers
Replace custom bit shifts and masks with lower/upper_32_bits helpers. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com> Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/sunxi-ss')
-rw-r--r--drivers/crypto/sunxi-ss/sun4i-ss-hash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
index 39f0abe5ee25..e53c3127b743 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
@@ -188,7 +188,6 @@ static int sun4i_hash(struct ahash_request *areq)
struct sg_mapping_iter mi;
int in_r, err = 0, zeros;
size_t copied = 0;
- __be64 bits;
dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x wl=%u h0=%0x",
__func__, crypto_tfm_alg_name(areq->base.tfm),
@@ -423,12 +422,13 @@ hash_final:
/* write the length of data */
if (op->mode == SS_OP_SHA1) {
- bits = cpu_to_be64(op->byte_count << 3);
- bf[j++] = bits & 0xffffffff;
- bf[j++] = (bits >> 32) & 0xffffffff;
+ __be64 bits = cpu_to_be64(op->byte_count << 3);
+ bf[j++] = lower_32_bits(bits);
+ bf[j++] = upper_32_bits(bits);
} else {
- bf[j++] = (op->byte_count << 3) & 0xffffffff;
- bf[j++] = (op->byte_count >> 29) & 0xffffffff;
+ __le64 bits = op->byte_count << 3;
+ bf[j++] = lower_32_bits(bits);
+ bf[j++] = upper_32_bits(bits);
}
writesl(ss->base + SS_RXFIFO, bf, j);