Skip to content

Commit 3685ebc

Browse files
rddunlapgregkh
authored andcommitted
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 <rdunlap@infradead.org> Reported-by: kbuild test robot <fengguang.wu@intel.com> Cc: Kamlakant Patel <kamlakant.patel@broadcom.com> Cc: Mona Anonuevo <manonuevo@micron.com> Cc: linux-mtd@lists.infradead.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e1feda1 commit 3685ebc

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎drivers/staging/mt29f_spinand/mt29f_spinand.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
/*
2929
* OOB area specification layout: Total 32 available free bytes.
3030
*/
31-
#ifdef CONFIG_MTD_SPINAND_ONDIEECC
32-
static int enable_hw_ecc;
33-
static int enable_read_hw_ecc;
3431

3532
static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
3633
{
@@ -41,6 +38,10 @@ static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
4138
return state;
4239
}
4340

41+
#ifdef CONFIG_MTD_SPINAND_ONDIEECC
42+
static int enable_hw_ecc;
43+
static int enable_read_hw_ecc;
44+
4445
static struct nand_ecclayout spinand_oob_64 = {
4546
.eccbytes = 24,
4647
.eccpos = {

0 commit comments

Comments
 (0)