From: Randy Dunlap Date: Mon, 14 Oct 2013 19:39:37 +0000 (-0700) Subject: staging/mt29f_spinand: fix build error when ONDIEECC not enabled X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3685ebc4bd2fb7da18b44a993d6c555ae31e5472;p=openwrt%2Fstaging%2Fblogic.git staging/mt29f_spinand: fix build error when ONDIEECC not enabled Fix build error when CONFIG_MTD_SPINAND_ONDIEECC is not enabled by moving an inline function outside of that #ifdef block. drivers/staging/mt29f_spinand/mt29f_spinand.c: In function 'spinand_read_byte': drivers/staging/mt29f_spinand/mt29f_spinand.c:665:9: error: implicit declaration of function 'mtd_to_state' [-Werror=implicit-function-declaration] drivers/staging/mt29f_spinand/mt29f_spinand.c:665:32: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/staging/mt29f_spinand/mt29f_spinand.c: In function 'spinand_write_buf': drivers/staging/mt29f_spinand/mt29f_spinand.c:700:32: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/staging/mt29f_spinand/mt29f_spinand.c: In function 'spinand_read_buf': drivers/staging/mt29f_spinand/mt29f_spinand.c:707:32: warning: initialization makes pointer from integer without a cast [enabled by default] Signed-off-by: Randy Dunlap Reported-by: kbuild test robot Cc: Kamlakant Patel Cc: Mona Anonuevo Cc: linux-mtd@lists.infradead.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c index 564707947598..51dbc13e757f 100644 --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c @@ -28,9 +28,6 @@ /* * OOB area specification layout: Total 32 available free bytes. */ -#ifdef CONFIG_MTD_SPINAND_ONDIEECC -static int enable_hw_ecc; -static int enable_read_hw_ecc; static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd) { @@ -41,6 +38,10 @@ static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd) return state; } +#ifdef CONFIG_MTD_SPINAND_ONDIEECC +static int enable_hw_ecc; +static int enable_read_hw_ecc; + static struct nand_ecclayout spinand_oob_64 = { .eccbytes = 24, .eccpos = {