mtd: mxc_nand: Fix warning on nr_parts unused variable

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Dec 3 11:59:05 EST 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=2ebf0622cdc5d2b51f22b68a0983d90df8a976c8
Commit:     2ebf0622cdc5d2b51f22b68a0983d90df8a976c8
Parent:     eeda667a29698b9a4d16dce8979afc6f512f3c42
Author:     Fabio Estevam <fabio.estevam at freescale.com>
AuthorDate: Tue Nov 23 17:02:13 2010 -0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Dec 3 16:34:41 2010 +0000

    mtd: mxc_nand: Fix warning on nr_parts unused variable
    
    If CONFIG_MTD_PARTITIONS is not selected, then the following warning is generated:
    
      CC      drivers/mtd/nand/mxc_nand.o
    drivers/mtd/nand/mxc_nand.c: In function 'mxcnd_probe':
    drivers/mtd/nand/mxc_nand.c:1014: warning: unused variable 'nr_parts'
    
    Fix it by marking nr_parts as __maybe_unused.
    
    Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/mxc_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 214b03a..ef932ba 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1009,7 +1009,7 @@ static int __init mxcnd_probe(struct platform_device *pdev)
 	struct mxc_nand_platform_data *pdata = pdev->dev.platform_data;
 	struct mxc_nand_host *host;
 	struct resource *res;
-	int err = 0, nr_parts = 0;
+	int err = 0, __maybe_unused nr_parts = 0;
 	struct nand_ecclayout *oob_smallpage, *oob_largepage;
 
 	/* Allocate memory for MTD device structure and private data */



More information about the linux-mtd-cvs mailing list