mtd: mtdcore: Fix build warning when CONFIG_MTD_CHAR is not defined

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Mar 26 20:59:02 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=335a5f409ee3960bda6b112b9d1a89d0a4e0a7eb
Commit:     335a5f409ee3960bda6b112b9d1a89d0a4e0a7eb
Parent:     70d5098a4b1551864dd7df43f67b7f606a1a6438
Author:     Fabio Estevam <festevam at gmail.com>
AuthorDate: Thu Jan 12 01:25:04 2012 -0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Tue Mar 27 00:11:16 2012 +0100

    mtd: mtdcore: Fix build warning when CONFIG_MTD_CHAR is not defined
    
    Fix the following build warning:
    
    drivers/mtd/mtdcore.c: In function ‘mtd_release’:
    drivers/mtd/mtdcore.c:110: warning: unused variable ‘mtd’
    
    This happens when neither CONFIG_MTD_CHAR nor CONFIG_MTD_CHAR_MODULE are defined.
    
    Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtdcore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 9a9ce71..de96865 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -107,7 +107,7 @@ static LIST_HEAD(mtd_notifiers);
  */
 static void mtd_release(struct device *dev)
 {
-	struct mtd_info *mtd = dev_get_drvdata(dev);
+	struct mtd_info __maybe_unused *mtd = dev_get_drvdata(dev);
 	dev_t index = MTD_DEVT(mtd->index);
 
 	/* remove /dev/mtdXro node if needed */



More information about the linux-mtd-cvs mailing list