2020-05-08 22:35:56

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 0/4] crypto: constify struct debugfs_reg32

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


2020-05-08 22:35:56

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 3/4] crypto: hisilicon/zip - constify struct debugfs_reg32

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 <[email protected]>
---
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

2020-05-08 22:35:56

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 1/4] crypto: ccree - constify struct debugfs_reg32

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 <[email protected]>
---
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

2020-05-08 22:35:56

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 4/4] crypto: hisilicon/sec2 - constify sec_dfx_regs

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 <[email protected]>
---
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

2020-05-08 22:36:51

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 2/4] crypto: hisilicon/hpre - constify struct debugfs_reg32

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 <[email protected]>
---
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

2020-05-09 01:50:23

by Zhou Wang

[permalink] [raw]
Subject: Re: [PATCH 3/4] crypto: hisilicon/zip - constify struct debugfs_reg32

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 <[email protected]>

Reviewed-by: Zhou Wang <[email protected]>

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},
>

2020-05-15 06:22:14

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 0/4] crypto: constify struct debugfs_reg32

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 <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt