Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/4] crypto: constify struct debugfs_reg32
@ 2020-05-08 22:34 Rikard Falkeborn
  2020-05-08 22:34 ` [PATCH 1/4] crypto: ccree - " Rikard Falkeborn
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Rikard Falkeborn @ 2020-05-08 22:34 UTC (permalink / raw)
  To: Gilad Ben-Yossef, Zaibo Xu, Zhou Wang
  Cc: herbert, davem, linux-crypto, linux-kernel, Rikard Falkeborn

A small series constifying struct debugfs_reg32 where it can be made
const. There's no dependency between the patches.

Rikard Falkeborn (4):
  crypto: ccree - constify struct debugfs_reg32
  crypto: hisilicon/hpre - constify struct debugfs_reg32
  crypto: hisilicon/zip - constify struct debugfs_reg32
  crypto: hisilicon/sec2 - constify sec_dfx_regs

 drivers/crypto/ccree/cc_debugfs.c         | 4 ++--
 drivers/crypto/hisilicon/hpre/hpre_main.c | 4 ++--
 drivers/crypto/hisilicon/sec2/sec_main.c  | 2 +-
 drivers/crypto/hisilicon/zip/zip_main.c   | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] crypto: ccree - constify struct debugfs_reg32
  2020-05-08 22:34 [PATCH 0/4] crypto: constify struct debugfs_reg32 Rikard Falkeborn
@ 2020-05-08 22:34 ` Rikard Falkeborn
  2020-05-08 22:35 ` [PATCH 2/4] crypto: hisilicon/hpre " Rikard Falkeborn
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Rikard Falkeborn @ 2020-05-08 22:34 UTC (permalink / raw)
  To: Gilad Ben-Yossef
  Cc: herbert, davem, linux-crypto, linux-kernel, Rikard Falkeborn

pid_cd_regs and debug_regs are never changed and can therefore be made
const.

This allows the compiler to put it in the text section instead of the
data section.

Before:
   text    data     bss     dec     hex filename
   2871    2320      64    5255    1487 drivers/crypto/ccree/cc_debugfs.o

After:
   text    data     bss     dec     hex filename
   3255    1936      64    5255    1487 drivers/crypto/ccree/cc_debugfs.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/crypto/ccree/cc_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ccree/cc_debugfs.c b/drivers/crypto/ccree/cc_debugfs.c
index c454afce7781..7083767602fc 100644
--- a/drivers/crypto/ccree/cc_debugfs.c
+++ b/drivers/crypto/ccree/cc_debugfs.c
@@ -26,7 +26,7 @@ static struct debugfs_reg32 ver_sig_regs[] = {
 	{ .name = "VERSION" }, /* Must be 1st */
 };
 
-static struct debugfs_reg32 pid_cid_regs[] = {
+static const struct debugfs_reg32 pid_cid_regs[] = {
 	CC_DEBUG_REG(PERIPHERAL_ID_0),
 	CC_DEBUG_REG(PERIPHERAL_ID_1),
 	CC_DEBUG_REG(PERIPHERAL_ID_2),
@@ -38,7 +38,7 @@ static struct debugfs_reg32 pid_cid_regs[] = {
 	CC_DEBUG_REG(COMPONENT_ID_3),
 };
 
-static struct debugfs_reg32 debug_regs[] = {
+static const struct debugfs_reg32 debug_regs[] = {
 	CC_DEBUG_REG(HOST_IRR),
 	CC_DEBUG_REG(HOST_POWER_DOWN_EN),
 	CC_DEBUG_REG(AXIM_MON_ERR),
-- 
2.26.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/4] crypto: hisilicon/hpre - constify struct debugfs_reg32
  2020-05-08 22:34 [PATCH 0/4] crypto: constify struct debugfs_reg32 Rikard Falkeborn
  2020-05-08 22:34 ` [PATCH 1/4] crypto: ccree - " Rikard Falkeborn
@ 2020-05-08 22:35 ` Rikard Falkeborn
  2020-05-08 22:35 ` [PATCH 3/4] crypto: hisilicon/zip " Rikard Falkeborn
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Rikard Falkeborn @ 2020-05-08 22:35 UTC (permalink / raw)
  To: Zaibo Xu; +Cc: herbert, davem, linux-crypto, linux-kernel, Rikard Falkeborn

hpre_cluster_dfx_regs and hpre_com_dfx_regs are never changed and can
therefore be made const.

This allows the compiler to put it in the text section instead of the
data section.

Before:
   text    data     bss     dec     hex filename
  16455    6288     480   23223    5ab7 drivers/crypto/hisilicon/hpre/hpre_main.o

After:
   text    data     bss     dec     hex filename
  16839    5904     480   23223    5ab7 drivers/crypto/hisilicon/hpre/hpre_main.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/crypto/hisilicon/hpre/hpre_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c
index 0d63666ba373..840e16c14570 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_main.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_main.c
@@ -134,7 +134,7 @@ static const u64 hpre_cluster_offsets[] = {
 		HPRE_CLSTR_BASE + HPRE_CLUSTER3 * HPRE_CLSTR_ADDR_INTRVL,
 };
 
-static struct debugfs_reg32 hpre_cluster_dfx_regs[] = {
+static const struct debugfs_reg32 hpre_cluster_dfx_regs[] = {
 	{"CORES_EN_STATUS          ",  HPRE_CORE_EN_OFFSET},
 	{"CORES_INI_CFG              ",  HPRE_CORE_INI_CFG_OFFSET},
 	{"CORES_INI_STATUS         ",  HPRE_CORE_INI_STATUS_OFFSET},
@@ -142,7 +142,7 @@ static struct debugfs_reg32 hpre_cluster_dfx_regs[] = {
 	{"CORES_IS_SCHD               ",  HPRE_CORE_IS_SCHD_OFFSET},
 };
 
-static struct debugfs_reg32 hpre_com_dfx_regs[] = {
+static const struct debugfs_reg32 hpre_com_dfx_regs[] = {
 	{"READ_CLR_EN          ",  HPRE_CTRL_CNT_CLR_CE},
 	{"AXQOS                   ",  HPRE_VFG_AXQOS},
 	{"AWUSR_CFG              ",  HPRE_AWUSR_FP_CFG},
-- 
2.26.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/4] crypto: hisilicon/zip - constify struct debugfs_reg32
  2020-05-08 22:34 [PATCH 0/4] crypto: constify struct debugfs_reg32 Rikard Falkeborn
  2020-05-08 22:34 ` [PATCH 1/4] crypto: ccree - " Rikard Falkeborn
  2020-05-08 22:35 ` [PATCH 2/4] crypto: hisilicon/hpre " Rikard Falkeborn
@ 2020-05-08 22:35 ` Rikard Falkeborn
  2020-05-09  1:49   ` Zhou Wang
  2020-05-08 22:35 ` [PATCH 4/4] crypto: hisilicon/sec2 - constify sec_dfx_regs Rikard Falkeborn
  2020-05-15  6:21 ` [PATCH 0/4] crypto: constify struct debugfs_reg32 Herbert Xu
  4 siblings, 1 reply; 7+ messages in thread
From: Rikard Falkeborn @ 2020-05-08 22:35 UTC (permalink / raw)
  To: Zhou Wang; +Cc: herbert, davem, linux-crypto, linux-kernel, Rikard Falkeborn

hzip_dfx_regs is never changed and can be made const.

This allows the compiler to put it in the text section instead of the
data section.

Before:
   text    data     bss     dec     hex filename
  15236    6160     480   21876    5574 drivers/crypto/hisilicon/zip/zip_main.o

After:
   text    data     bss     dec     hex filename
  15620    5776     480   21876    5574 drivers/crypto/hisilicon/zip/zip_main.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/crypto/hisilicon/zip/zip_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c
index 37db11f96fab..6934a03d21e1 100644
--- a/drivers/crypto/hisilicon/zip/zip_main.c
+++ b/drivers/crypto/hisilicon/zip/zip_main.c
@@ -165,7 +165,7 @@ static const u64 core_offsets[] = {
 	[HZIP_DECOMP_CORE5] = 0x309000,
 };
 
-static struct debugfs_reg32 hzip_dfx_regs[] = {
+static const struct debugfs_reg32 hzip_dfx_regs[] = {
 	{"HZIP_GET_BD_NUM                ",  0x00ull},
 	{"HZIP_GET_RIGHT_BD              ",  0x04ull},
 	{"HZIP_GET_ERROR_BD              ",  0x08ull},
-- 
2.26.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/4] crypto: hisilicon/sec2 - constify sec_dfx_regs
  2020-05-08 22:34 [PATCH 0/4] crypto: constify struct debugfs_reg32 Rikard Falkeborn
                   ` (2 preceding siblings ...)
  2020-05-08 22:35 ` [PATCH 3/4] crypto: hisilicon/zip " Rikard Falkeborn
@ 2020-05-08 22:35 ` Rikard Falkeborn
  2020-05-15  6:21 ` [PATCH 0/4] crypto: constify struct debugfs_reg32 Herbert Xu
  4 siblings, 0 replies; 7+ messages in thread
From: Rikard Falkeborn @ 2020-05-08 22:35 UTC (permalink / raw)
  To: Zaibo Xu; +Cc: herbert, davem, linux-crypto, linux-kernel, Rikard Falkeborn

sec_dfx_regs is never changed and can therefore be made const.

This allows the compiler to put it in the text section instead of the
data section.

Before:
   text    data     bss     dec     hex filename
  17982    7312     480   25774    64ae drivers/crypto/hisilicon/sec2/sec_main.o

After:
   text    data     bss     dec     hex filename
  18366    6928     480   25774    64ae drivers/crypto/hisilicon/sec2/sec_main.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/crypto/hisilicon/sec2/sec_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c
index 07a5f4eb96ff..6f577b34098f 100644
--- a/drivers/crypto/hisilicon/sec2/sec_main.c
+++ b/drivers/crypto/hisilicon/sec2/sec_main.c
@@ -110,7 +110,7 @@ static const char * const sec_dbg_file_name[] = {
 	[SEC_CLEAR_ENABLE] = "clear_enable",
 };
 
-static struct debugfs_reg32 sec_dfx_regs[] = {
+static const struct debugfs_reg32 sec_dfx_regs[] = {
 	{"SEC_PF_ABNORMAL_INT_SOURCE    ",  0x301010},
 	{"SEC_SAA_EN                    ",  0x301270},
 	{"SEC_BD_LATENCY_MIN            ",  0x301600},
-- 
2.26.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/4] crypto: hisilicon/zip - constify struct debugfs_reg32
  2020-05-08 22:35 ` [PATCH 3/4] crypto: hisilicon/zip " Rikard Falkeborn
@ 2020-05-09  1:49   ` Zhou Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Zhou Wang @ 2020-05-09  1:49 UTC (permalink / raw)
  To: Rikard Falkeborn; +Cc: herbert, davem, linux-crypto, linux-kernel

On 2020/5/9 6:35, Rikard Falkeborn wrote:
> hzip_dfx_regs is never changed and can be made const.
> 
> This allows the compiler to put it in the text section instead of the
> data section.
> 
> Before:
>    text    data     bss     dec     hex filename
>   15236    6160     480   21876    5574 drivers/crypto/hisilicon/zip/zip_main.o
> 
> After:
>    text    data     bss     dec     hex filename
>   15620    5776     480   21876    5574 drivers/crypto/hisilicon/zip/zip_main.o
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>

Thanks for fixing this.

> ---
>  drivers/crypto/hisilicon/zip/zip_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c
> index 37db11f96fab..6934a03d21e1 100644
> --- a/drivers/crypto/hisilicon/zip/zip_main.c
> +++ b/drivers/crypto/hisilicon/zip/zip_main.c
> @@ -165,7 +165,7 @@ static const u64 core_offsets[] = {
>  	[HZIP_DECOMP_CORE5] = 0x309000,
>  };
>  
> -static struct debugfs_reg32 hzip_dfx_regs[] = {
> +static const struct debugfs_reg32 hzip_dfx_regs[] = {
>  	{"HZIP_GET_BD_NUM                ",  0x00ull},
>  	{"HZIP_GET_RIGHT_BD              ",  0x04ull},
>  	{"HZIP_GET_ERROR_BD              ",  0x08ull},
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] crypto: constify struct debugfs_reg32
  2020-05-08 22:34 [PATCH 0/4] crypto: constify struct debugfs_reg32 Rikard Falkeborn
                   ` (3 preceding siblings ...)
  2020-05-08 22:35 ` [PATCH 4/4] crypto: hisilicon/sec2 - constify sec_dfx_regs Rikard Falkeborn
@ 2020-05-15  6:21 ` Herbert Xu
  4 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2020-05-15  6:21 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Gilad Ben-Yossef, Zaibo Xu, Zhou Wang, davem, linux-crypto, linux-kernel

On Sat, May 09, 2020 at 12:34:58AM +0200, Rikard Falkeborn wrote:
> A small series constifying struct debugfs_reg32 where it can be made
> const. There's no dependency between the patches.
> 
> Rikard Falkeborn (4):
>   crypto: ccree - constify struct debugfs_reg32
>   crypto: hisilicon/hpre - constify struct debugfs_reg32
>   crypto: hisilicon/zip - constify struct debugfs_reg32
>   crypto: hisilicon/sec2 - constify sec_dfx_regs
> 
>  drivers/crypto/ccree/cc_debugfs.c         | 4 ++--
>  drivers/crypto/hisilicon/hpre/hpre_main.c | 4 ++--
>  drivers/crypto/hisilicon/sec2/sec_main.c  | 2 +-
>  drivers/crypto/hisilicon/zip/zip_main.c   | 2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 22:34 [PATCH 0/4] crypto: constify struct debugfs_reg32 Rikard Falkeborn
2020-05-08 22:34 ` [PATCH 1/4] crypto: ccree - " Rikard Falkeborn
2020-05-08 22:35 ` [PATCH 2/4] crypto: hisilicon/hpre " Rikard Falkeborn
2020-05-08 22:35 ` [PATCH 3/4] crypto: hisilicon/zip " Rikard Falkeborn
2020-05-09  1:49   ` Zhou Wang
2020-05-08 22:35 ` [PATCH 4/4] crypto: hisilicon/sec2 - constify sec_dfx_regs Rikard Falkeborn
2020-05-15  6:21 ` [PATCH 0/4] crypto: constify struct debugfs_reg32 Herbert Xu

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git