Skip to content

Commit 5a368fb

Browse files
ColinIanKingmiquelraynal
authored andcommitted
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
1 parent 5fc69b6 commit 5a368fb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mtd/nand/ecc-mxic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ static int mxic_ecc_init_ctx(struct nand_device *nand, struct device *dev)
224224
struct nand_ecc_props *user = &nand->ecc.user_conf;
225225
struct mtd_info *mtd = nanddev_to_mtd(nand);
226226
int step_size = 0, strength = 0, desired_correction = 0, steps, idx;
227-
int possible_strength[] = {4, 8, 40, 48};
228-
int spare_size[] = {32, 32, 96, 96};
227+
static const int possible_strength[] = {4, 8, 40, 48};
228+
static const int spare_size[] = {32, 32, 96, 96};
229229
struct mxic_ecc_ctx *ctx;
230230
u32 spare_reg;
231231
int ret;

0 commit comments

Comments
 (0)