[PATCH] MTD: fix 2 "unused variable" warnings in cafe_nand.c

From: Toralf Förster
Date: Mon May 26 2008 - 14:36:33 EST


Hello,

pointed out by Sebastian Siewior the original patch produces the compiler
warning "ISO C90 forbids mixed declarations and code" therefore here the 2nd
attempt to fix 2 compiler warnings about unused variables if
CONFIG_MTD_PARTITIONS is undefined.

BTW I'm wondering whether the devs prefer to live w/ the warning rather than
having the 2 additional #ifdef pragmas or not.


Signed-off-by: Toralf Förster <toralf.foerster@xxxxxx>
---
drivers/mtd/nand/cafe_nand.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index da6ceaa..5c29d36 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -626,10 +626,12 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
{
struct mtd_info *mtd;
struct cafe_priv *cafe;
- struct mtd_partition *parts;
uint32_t ctrl;
- int nr_parts;
int err = 0;
+#ifdef CONFIG_MTD_PARTITIONS
+ struct mtd_partition *parts;
+ int nr_parts;
+#endif

/* Very old versions shared the same PCI ident for all three
functions on the chip. Verify the class too... */
--
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

Attachment: signature.asc
Description: This is a digitally signed message part.