crypto: constify struct debugfs_reg32
Subsystems (5)
cover 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(-)
Signature · 1 line
2.26.2
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
--- drivers/crypto/ccree/cc_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/ccree/cc_debugfs.c +2 -2
@@ -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 ),
Signature · 1 line
2.26.2
PATCH 2/4 crypto: hisilicon/hpre - constify struct debugfs_reg32
In reply to Rikard Falkebornhpre_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
--- drivers/crypto/hisilicon/hpre/hpre_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/hisilicon/hpre/hpre_main.c +2 -2
@@ -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},
Signature · 1 line
2.26.2
PATCH 3/4 crypto: hisilicon/zip - constify struct debugfs_reg32
In reply to Rikard Falkebornhzip_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
--- drivers/crypto/hisilicon/zip/zip_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/hisilicon/zip/zip_main.c +1 -1
@@ -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 },
Signature · 1 line
2.26.2
Re: [PATCH 3/4] crypto: hisilicon/zip - constify struct debugfs_reg32
Quoted 6 lines · Rikard Falkeborn
hzip_dfx_regsis never changed and can be made const.This allows the compiler to put it in the text section instead of the data section.
Before:
Quoted 8 lines
text data bss dec hex filename 15236 6160 480 21876 5574 drivers/crypto/hisilicon/zip/zip_main.oAfter:
text data bss dec hex filename 15620 5776 480 21876 5574 drivers/crypto/hisilicon/zip/zip_main.oSigned-off-by Rikard Falkeborn <[email protected]>
Thanks for fixing this.
Quoted 18 lines
--- drivers/crypto/hisilicon/zip/zip_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/crypto/hisilicon/zip/zip_main.c +1
-1@@ -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 },
PATCH 4/4 crypto: hisilicon/sec2 - constify sec_dfx_regs
In reply to Rikard Falkebornsec_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
--- drivers/crypto/hisilicon/sec2/sec_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/hisilicon/sec2/sec_main.c +1 -1
@@ -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 },
Signature · 1 line
2.26.2
Herbert Xu
maintainerQuoted 9 lines · Rikard Falkeborn
A small series constifying struct
debugfs_reg32where it can be made const. There's no dependency between the patches.Rikard Falkeborn (4):
crypto: ccree - constify structdebugfs_reg32
crypto: hisilicon/hpre - constify structdebugfs_reg32
crypto: hisilicon/zip - constify structdebugfs_reg32
crypto: hisilicon/sec2 - constifysec_dfx_regs
Quoted 5 lines
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.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt