diff options
author | Cyrille Pitchen <cyrille.pitchen@atmel.com> | 2017-01-26 19:07:49 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-02-03 13:16:12 +0300 |
commit | f07cebad63b28562d030eee8c762833eca50e46e (patch) | |
tree | 60241c43a632391eccaea51b583f53a4d55fb74e /drivers/crypto/atmel-sha-regs.h | |
parent | b5ce82a7b4938f278fc6da28ce00da34e7a0773c (diff) | |
download | linux-f07cebad63b28562d030eee8c762833eca50e46e.tar.xz |
crypto: atmel-sha - redefine SHA_FLAGS_SHA* flags to match SHA_MR_ALGO_SHA*
This patch modifies the SHA_FLAGS_SHA* flags: those algo flags are now
organized as values of a single bitfield instead of individual bits.
This allows to reduce the number of bits needed to encode all possible
values. Also the new values match the SHA_MR_ALGO_SHA* values hence
the algorithm bitfield of the SHA_MR register could simply be set with:
mr = (mr & ~SHA_FLAGS_ALGO_MASK) | (ctx->flags & SHA_FLAGS_ALGO_MASK)
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-sha-regs.h')
-rw-r--r-- | drivers/crypto/atmel-sha-regs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/atmel-sha-regs.h b/drivers/crypto/atmel-sha-regs.h index e08897109cab..deb0b0b15096 100644 --- a/drivers/crypto/atmel-sha-regs.h +++ b/drivers/crypto/atmel-sha-regs.h @@ -19,6 +19,7 @@ #define SHA_MR_PROCDLY (1 << 4) #define SHA_MR_UIHV (1 << 5) #define SHA_MR_UIEHV (1 << 6) +#define SHA_MR_ALGO_MASK GENMASK(10, 8) #define SHA_MR_ALGO_SHA1 (0 << 8) #define SHA_MR_ALGO_SHA256 (1 << 8) #define SHA_MR_ALGO_SHA384 (2 << 8) |