Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pmdomain: amlogic: Constify struct meson_secure_pwrc_domain_data

'struct meson_secure_pwrc_domain_data' are not modified in these drivers.

Constifying these structures moves some data to a read-only section, so
increases overall security.

On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
9248 408 0 9656 25b8 drivers/pmdomain/amlogic/meson-secure-pwrc.o

After:
=====
text data bss dec hex filename
9344 304 0 9648 25b0 drivers/pmdomain/amlogic/meson-secure-pwrc.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/e71abd8d75dd842690e5a11e38037bcf5feac189.1751816732.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Christophe JAILLET and committed by
Ulf Hansson
3b2ded23 a4abebf3

+6 -6
+6 -6
drivers/pmdomain/amlogic/meson-secure-pwrc.c
··· 342 342 return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate); 343 343 } 344 344 345 - static struct meson_secure_pwrc_domain_data meson_secure_a1_pwrc_data = { 345 + static const struct meson_secure_pwrc_domain_data meson_secure_a1_pwrc_data = { 346 346 .domains = a1_pwrc_domains, 347 347 .count = ARRAY_SIZE(a1_pwrc_domains), 348 348 }; 349 349 350 - static struct meson_secure_pwrc_domain_data amlogic_secure_a4_pwrc_data = { 350 + static const struct meson_secure_pwrc_domain_data amlogic_secure_a4_pwrc_data = { 351 351 .domains = a4_pwrc_domains, 352 352 .count = ARRAY_SIZE(a4_pwrc_domains), 353 353 }; 354 354 355 - static struct meson_secure_pwrc_domain_data amlogic_secure_a5_pwrc_data = { 355 + static const struct meson_secure_pwrc_domain_data amlogic_secure_a5_pwrc_data = { 356 356 .domains = a5_pwrc_domains, 357 357 .count = ARRAY_SIZE(a5_pwrc_domains), 358 358 }; 359 359 360 - static struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = { 360 + static const struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = { 361 361 .domains = c3_pwrc_domains, 362 362 .count = ARRAY_SIZE(c3_pwrc_domains), 363 363 }; 364 364 365 - static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = { 365 + static const struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = { 366 366 .domains = s4_pwrc_domains, 367 367 .count = ARRAY_SIZE(s4_pwrc_domains), 368 368 }; 369 369 370 - static struct meson_secure_pwrc_domain_data amlogic_secure_t7_pwrc_data = { 370 + static const struct meson_secure_pwrc_domain_data amlogic_secure_t7_pwrc_data = { 371 371 .domains = t7_pwrc_domains, 372 372 .count = ARRAY_SIZE(t7_pwrc_domains), 373 373 };