Skip to content

Commit ded525f

Browse files
tititiou36AngeloGioacchino Del Regno
authored andcommitted
soc: mediatek: pwrap: Constify struct pmic_wrapper_type
'struct pmic_wrapper_type' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 45336 8724 16 54076 d33c drivers/soc/mediatek/mtk-pmic-wrap.o After: ===== text data bss dec hex filename 45528 8532 16 54076 d33c drivers/soc/mediatek/mtk-pmic-wrap.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/5b4b60c5dfd6d8fe893b05cfc96c0e2d67705463.1720331018.git.christophe.jaillet@wanadoo.fr Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
1 parent 8400291 commit ded525f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/soc/mediatek/mtk-pmic-wrap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,7 @@ static const struct pmic_wrapper_type pwrap_mt8183 = {
23972397
.init_soc_specific = pwrap_mt8183_init_soc_specific,
23982398
};
23992399

2400-
static struct pmic_wrapper_type pwrap_mt8195 = {
2400+
static const struct pmic_wrapper_type pwrap_mt8195 = {
24012401
.regs = mt8195_regs,
24022402
.type = PWRAP_MT8195,
24032403
.arb_en_all = 0x777f, /* NEED CONFIRM */
@@ -2423,7 +2423,7 @@ static const struct pmic_wrapper_type pwrap_mt8365 = {
24232423
.init_soc_specific = NULL,
24242424
};
24252425

2426-
static struct pmic_wrapper_type pwrap_mt8516 = {
2426+
static const struct pmic_wrapper_type pwrap_mt8516 = {
24272427
.regs = mt8516_regs,
24282428
.type = PWRAP_MT8516,
24292429
.arb_en_all = 0xff,
@@ -2435,7 +2435,7 @@ static struct pmic_wrapper_type pwrap_mt8516 = {
24352435
.init_soc_specific = NULL,
24362436
};
24372437

2438-
static struct pmic_wrapper_type pwrap_mt8186 = {
2438+
static const struct pmic_wrapper_type pwrap_mt8186 = {
24392439
.regs = mt8186_regs,
24402440
.type = PWRAP_MT8186,
24412441
.arb_en_all = 0xfb27f,

0 commit comments

Comments
 (0)