summaryrefslogtreecommitdiff
path: root/drivers/crypto/hisilicon/hpre/hpre_crypto.c
diff options
context:
space:
mode:
authorHui Tang <tanghui20@huawei.com>2021-05-12 14:27:09 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-05-21 16:17:31 +0800
commit82119db8cacb3921ab95e3f078c08c4bffacef15 (patch)
treeeebba245985f9ec002730c735df9961e3be1b633 /drivers/crypto/hisilicon/hpre/hpre_crypto.c
parent58be5ce3461e3fd623091d0bdc1080d0e4df2859 (diff)
downloadlwn-82119db8cacb3921ab95e3f078c08c4bffacef15.tar.gz
lwn-82119db8cacb3921ab95e3f078c08c4bffacef15.zip
crypto: hisilicon/hpre - use 'GENMASK' to generate mask value
Use 'GENMASK' to generate mask value, just make the code clearer. Signed-off-by: Hui Tang <tanghui20@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon/hpre/hpre_crypto.c')
-rw-r--r--drivers/crypto/hisilicon/hpre/hpre_crypto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
index bc93cc926e22..7449632986c5 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
@@ -330,9 +330,9 @@ static int hpre_alg_res_post_hf(struct hpre_ctx *ctx, struct hpre_sqe *sqe,
#define HPRE_NO_HW_ERR 0
#define HPRE_HW_TASK_DONE 3
-#define HREE_HW_ERR_MASK 0x7ff
-#define HREE_SQE_DONE_MASK 0x3
-#define HREE_ALG_TYPE_MASK 0x1f
+#define HREE_HW_ERR_MASK GENMASK(10, 0)
+#define HREE_SQE_DONE_MASK GENMASK(1, 0)
+#define HREE_ALG_TYPE_MASK GENMASK(4, 0)
id = (int)le16_to_cpu(sqe->tag);
req = ctx->req_list[id];
hpre_rm_req_from_ctx(req);