mtd: parsers: bcm47xxpart: make read-only array possible_nvram_sizes static const
Subsystems (2)
PATCH 1/1 mtd: parsers: bcm47xxpart: make read-only array possible_nvram_sizes static const
Don't populate the read-only array possible_nvram_sizes on the stack at run time, instead make it static const.
Signed-off-by Colin Ian King <[email protected]>
--- drivers/mtd/parsers/bcm47xxpart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/parsers/bcm47xxpart.c +1 -1
@@ -95,7 +95,7 @@ static int bcm47xxpart_parse(struct mtd_info *master,uint32_t blocksize = master->erasesize;int trx_parts[2 ];/* Array with indexes of TRX partitions */ int trx_num =0 ;/* Number of found TRX partitions */ -int possible_nvram_sizes[] = {0x8000 ,0xF000 ,0x10000 , }; +static const int possible_nvram_sizes[] = {0x8000 ,0xF000 ,0x10000 , };int err;/*
Signature · 1 line
2.39.2
Quoted 4 lines · Colin Ian King
Don't populate the read-only array
possible_nvram_sizeson the stack at run time, instead make it static const.Signed-off-by Colin Ian King <[email protected]>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel