aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2022-03-07 23:09:40 +0000
committerMiquel Raynal <miquel.raynal@bootlin.com>2022-03-14 17:01:58 +0100
commit5a368fb65ad9aaf68f2bbe02d42969741317d44c (patch)
tree311fbace79798cf8a5616112de715f85bc473038 /drivers/mtd/nand
parentmtd: hyperbus: HBMC_AM654 should depend on ARCH_K3 (diff)
downloadlinux-dev-5a368fb65ad9aaf68f2bbe02d42969741317d44c.tar.xz
linux-dev-5a368fb65ad9aaf68f2bbe02d42969741317d44c.zip
mtd: nand: mxic-ecc: make two read-only arrays static const
Don't populate the read-only arrays possible_strength and spare_size on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220307230940.169235-1-colin.i.king@gmail.com
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/ecc-mxic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/ecc-mxic.c b/drivers/mtd/nand/ecc-mxic.c
index c122139255e5..8afdca731b87 100644
--- a/drivers/mtd/nand/ecc-mxic.c
+++ b/drivers/mtd/nand/ecc-mxic.c
@@ -224,8 +224,8 @@ static int mxic_ecc_init_ctx(struct nand_device *nand, struct device *dev)
struct nand_ecc_props *user = &nand->ecc.user_conf;
struct mtd_info *mtd = nanddev_to_mtd(nand);
int step_size = 0, strength = 0, desired_correction = 0, steps, idx;
- int possible_strength[] = {4, 8, 40, 48};
- int spare_size[] = {32, 32, 96, 96};
+ static const int possible_strength[] = {4, 8, 40, 48};
+ static const int spare_size[] = {32, 32, 96, 96};
struct mxic_ecc_ctx *ctx;
u32 spare_reg;
int ret;