Skip to contentSkip to conversation

mtd: rawnand: meson: fix build error

PATCH Applied Arseniy Krasnov 2 participants 2 messages Jul 28, 2023

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

PATCH 1/1 mtd: rawnand: meson: fix build error

Fixes the following build error:

drivers/mtd/nand/raw/meson_nand.c:244:59: error: initializer element is not a compile-time constant

static const struct nand_ecc_step_info axg_stepinfo[] = { axg_stepinfo_1024, axg_stepinfo_512 };
                                                          ^~~~~~~~~~~~~~~~~
Fixes 0e1db39336d8 ("mtd: rawnand: meson: support for 512B ECC step size")
---
 drivers/mtd/nand/raw/meson_nand.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/mtd/nand/raw/meson_nand.c +11 -11
index ff673a9d52af..561d46d860b7 100644
@@ -229,20 +229,20 @@ NAND_ECC_CAPS_SINGLE(meson_gxl_ecc_caps,
 		     meson_nand_calc_ecc_bytes, 1024, 8, 24, 30, 40, 50, 60);
 
 static const int axg_stepinfo_strengths[] = { 8 };
-static const struct nand_ecc_step_info axg_stepinfo_1024 = {
-	.stepsize = 1024,
-	.strengths = axg_stepinfo_strengths,
-	.nstrengths = ARRAY_SIZE(axg_stepinfo_strengths)
-};
 
-static const struct nand_ecc_step_info axg_stepinfo_512 = {
-	.stepsize = 512,
-	.strengths = axg_stepinfo_strengths,
-	.nstrengths = ARRAY_SIZE(axg_stepinfo_strengths)
+static const struct nand_ecc_step_info axg_stepinfo[] = {
+	{
+		.stepsize = 1024,
+		.strengths = axg_stepinfo_strengths,
+		.nstrengths = ARRAY_SIZE(axg_stepinfo_strengths)
+	},
+	{
+		.stepsize = 512,
+		.strengths = axg_stepinfo_strengths,
+		.nstrengths = ARRAY_SIZE(axg_stepinfo_strengths)
+	},
 };
 
-static const struct nand_ecc_step_info axg_stepinfo[] = { axg_stepinfo_1024, axg_stepinfo_512 };
-
 static const struct nand_ecc_caps meson_axg_ecc_caps = {
 	.stepinfos = axg_stepinfo,
 	.nstepinfos = ARRAY_SIZE(axg_stepinfo),
Signature · 1 line
2.35.0
maintainer Applied
#1 lore raw
Quoted 10 lines · Arseniy Krasnov

Fixes the following build error:

drivers/mtd/nand/raw/meson_nand.c:244:59: error: initializer element is not a compile-time constant

static const struct nand_ecc_step_info axg_stepinfo[] = { axg_stepinfo_1024, axg_stepinfo_512 };
                                                          ^~~~~~~~~~~~~~~~~
Fixes 0e1db39336d8 ("mtd: rawnand: meson: support for 512B ECC step size")

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

Miquel