diff mbox

nand: omap2: Fix warning when CONFIG_MTD_NAND_OMAP_BCH=n

Message ID 1396962300-4956-1-git-send-email-fabio.estevam@freescale.com
State Superseded
Headers show

Commit Message

Fabio Estevam April 8, 2014, 1:05 p.m. UTC
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@freescale.com>
---
 drivers/mtd/nand/omap2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brian Norris April 16, 2014, 7:41 a.m. UTC | #1
Hi Fabio,

On Tue, Apr 08, 2014 at 10:05:00AM -0300, Fabio Estevam wrote:
> 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@freescale.com>

I've already merged a patch for this. (Incidentally, it was sent after
yours, but I noticed it first. Oh well.)

Thanks,
Brian
diff mbox

Patch

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