linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] mtd: nand: mxic-ecc: make two read-only arrays static const
@ 2022-03-07 23:09 Colin Ian King
  2022-03-14 15:59 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-03-07 23:09 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, linux-mtd
  Cc: kernel-janitors, linux-kernel

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>
---
 drivers/mtd/nand/ecc-mxic.c | 4 ++--
 1 file 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;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] mtd: nand: mxic-ecc: make two read-only arrays static const
  2022-03-07 23:09 [PATCH][next] mtd: nand: mxic-ecc: make two read-only arrays static const Colin Ian King
@ 2022-03-14 15:59 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2022-03-14 15:59 UTC (permalink / raw)
  To: Colin Ian King, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd
  Cc: kernel-janitors, linux-kernel

On Mon, 2022-03-07 at 23:09:40 UTC, Colin Ian King wrote:
> 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>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-14 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 23:09 [PATCH][next] mtd: nand: mxic-ecc: make two read-only arrays static const Colin Ian King
2022-03-14 15:59 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).