mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
mtd: spi-nor: Constify struct spi_nor_fixups
'struct spi_nor_fixups' are not modified in this driver. Constifying these structures moves some data to a read-only section, so increases overall security, especially when the structure holds some function pointers. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 23304 13168 0 36472 8e78 drivers/mtd/spi-nor/micron-st.o After: ===== text data bss dec hex filename 23560 12912 0 36472 8e78 drivers/mtd/spi-nor/micron-st.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Pratyush Yadav <pratyush@kernel.org> Signed-off-by: Pratyush Yadav <pratyush@kernel.org> Link: https://lore.kernel.org/r/aa641732ba707ce3690217825c3ca7373ffde4f9.1748191985.git.christophe.jaillet@wanadoo.fr
This commit is contained in:
parent
19272b37aa
commit
d8b73ce1c5
|
|
@ -189,7 +189,7 @@ static int mt25qu512a_post_bfpt_fixup(struct spi_nor *nor,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct spi_nor_fixups mt25qu512a_fixups = {
|
||||
static const struct spi_nor_fixups mt25qu512a_fixups = {
|
||||
.post_bfpt = mt25qu512a_post_bfpt_fixup,
|
||||
};
|
||||
|
||||
|
|
@ -225,15 +225,15 @@ static int st_nor_two_die_late_init(struct spi_nor *nor)
|
|||
return spi_nor_set_4byte_addr_mode(nor, true);
|
||||
}
|
||||
|
||||
static struct spi_nor_fixups n25q00_fixups = {
|
||||
static const struct spi_nor_fixups n25q00_fixups = {
|
||||
.late_init = st_nor_four_die_late_init,
|
||||
};
|
||||
|
||||
static struct spi_nor_fixups mt25q01_fixups = {
|
||||
static const struct spi_nor_fixups mt25q01_fixups = {
|
||||
.late_init = st_nor_two_die_late_init,
|
||||
};
|
||||
|
||||
static struct spi_nor_fixups mt25q02_fixups = {
|
||||
static const struct spi_nor_fixups mt25q02_fixups = {
|
||||
.late_init = st_nor_four_die_late_init,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@ static int s25fs256t_late_init(struct spi_nor *nor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct spi_nor_fixups s25fs256t_fixups = {
|
||||
static const struct spi_nor_fixups s25fs256t_fixups = {
|
||||
.post_bfpt = s25fs256t_post_bfpt_fixup,
|
||||
.post_sfdp = s25fs256t_post_sfdp_fixup,
|
||||
.late_init = s25fs256t_late_init,
|
||||
|
|
@ -650,7 +650,7 @@ static int s25hx_t_late_init(struct spi_nor *nor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct spi_nor_fixups s25hx_t_fixups = {
|
||||
static const struct spi_nor_fixups s25hx_t_fixups = {
|
||||
.post_bfpt = s25hx_t_post_bfpt_fixup,
|
||||
.post_sfdp = s25hx_t_post_sfdp_fixup,
|
||||
.late_init = s25hx_t_late_init,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user