[PATCH] nand: omap2: Fix warning when CONFIG_MTD_NAND_OMAP_BCH=n

Fabio Estevam fabio.estevam at freescale.com
Tue Apr 8 06:05:00 PDT 2014


When CONFIG_MTD_NAND_OMAP_BCH is not defined the following build warning 
happens:

drivers/mtd/nand/omap2.c:1250:12: warning: 'erased_sector_bitflips' defined but not used [-Wunused-function]

Protect the definition of erased_sector_bitflips() with 
'ifdef CONFIG_MTD_NAND_OMAP_BCH' to fix the warning.

Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
 drivers/mtd/nand/omap2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 1ff49b8..4c4c700 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1247,6 +1247,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
  * If falls below, report the page as erased with correctable bit
  * flip, else report as uncorrectable page.
  */
+#ifdef CONFIG_MTD_NAND_OMAP_BCH
 static int erased_sector_bitflips(u_char *data, u_char *oob,
 		struct omap_nand_info *info)
 {
@@ -1276,7 +1277,6 @@ static int erased_sector_bitflips(u_char *data, u_char *oob,
 	return flip_bits;
 }
 
-#ifdef CONFIG_MTD_NAND_OMAP_BCH
 /**
  * omap_elm_correct_data - corrects page data area in case error reported
  * @mtd:	MTD device structure
-- 
1.8.3.2





More information about the linux-mtd mailing list