From: Joe Perches <joe@perches.com>
To: Kai Ye <yekai13@huawei.com>, herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
wangzhou1@hisilicon.com
Subject: Re: [PATCH v2 1/5] crypto: hisilicon/sgl - fixup coding style
Date: Tue, 30 Mar 2021 00:53:27 -0700 [thread overview]
Message-ID: <c18ee8d6786b0aa4d6c868ac2c12e684f348daff.camel@perches.com> (raw)
In-Reply-To: <1617089946-48078-2-git-send-email-yekai13@huawei.com>
On Tue, 2021-03-30 at 15:39 +0800, Kai Ye wrote:
> use a macro replace of a magic number.
Given the use of 32 in the same test, this
seems more obfuscating that useful to me.
> diff --git 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;
next prev parent reply other threads:[~2021-03-30 7:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 7:39 [PATCH v2 0/5] bug fix and clear " Kai Ye
2021-03-30 7:39 ` [PATCH v2 1/5] crypto: hisilicon/sgl - fixup " Kai Ye
2021-03-30 7:53 ` Joe Perches [this message]
2021-03-30 7:39 ` [PATCH v2 2/5] crypto: hisilicon/sgl - delete unneeded variable initialization Kai Ye
2021-03-30 7:39 ` [PATCH v2 3/5] crypto: hisilicon/sgl - add some dfx logs Kai Ye
2021-03-30 7:56 ` Joe Perches
2021-03-30 9:24 ` yekai(A)
2021-03-30 7:39 ` [PATCH v2 4/5] crypto: hisilicon/sgl - fix the soft sg map to hardware sg Kai Ye
2021-03-30 7:39 ` [PATCH v2 5/5] crypto: hisilicon/sgl - fix the sg buf unmap Kai Ye
2021-04-09 7:43 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c18ee8d6786b0aa4d6c868ac2c12e684f348daff.camel@perches.com \
--to=joe@perches.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangzhou1@hisilicon.com \
--cc=yekai13@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®