Skip to contentSkip to conversation

mtd: nand: mxic-ecc: make two read-only arrays static const

PATCH Applied Colin Ian King 2 participants 2 messages Mar 7, 2022 – Mar 14, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/mtd/nand/ecc-mxic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/ecc-mxic.c +2 -2
index c122139255e5..8afdca731b87 100644
@@ -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;
Signature · 1 line
2.35.1