[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1617089946-48078-2-git-send-email-yekai13@huawei.com>
Date: Tue, 30 Mar 2021 15:39:02 +0800
From: Kai Ye <yekai13@...wei.com>
To: <herbert@...dor.apana.org.au>
CC: <linux-crypto@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<wangzhou1@...ilicon.com>, <yekai13@...wei.com>
Subject: [PATCH v2 1/5] crypto: hisilicon/sgl - fixup coding style
use a macro replace of a magic number.
Signed-off-by: Kai Ye <yekai13@...wei.com>
---
drivers/crypto/hisilicon/sgl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c
index 3bff639..bd5ef40 100644
--- a/drivers/crypto/hisilicon/sgl.c
+++ b/drivers/crypto/hisilicon/sgl.c
@@ -9,6 +9,7 @@
#define HISI_ACC_SGL_NR_MAX 256
#define HISI_ACC_SGL_ALIGN_SIZE 64
#define HISI_ACC_MEM_BLOCK_NR 5
+#define HISI_ACC_BLOCK_SIZE_MAX_SHIFT 31
struct acc_hw_sge {
dma_addr_t buf;
@@ -67,7 +68,8 @@ struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev,
sgl_size = sizeof(struct acc_hw_sge) * sge_nr +
sizeof(struct hisi_acc_hw_sgl);
block_size = 1 << (PAGE_SHIFT + MAX_ORDER <= 32 ?
- PAGE_SHIFT + MAX_ORDER - 1 : 31);
+ PAGE_SHIFT + MAX_ORDER - 1 :
+ HISI_ACC_BLOCK_SIZE_MAX_SHIFT);
sgl_num_per_block = block_size / sgl_size;
block_num = count / sgl_num_per_block;
remain_sgl = count % sgl_num_per_block;
--
2.8.1
Powered by blists - more mailing lists