Skip to contentSkip to conversation

MTD: fix 2 "unused variables" warnings in drivers/mtd/nand/cafe_nand.c

PATCH In review Toralf Förster 2 participants 2 messages May 26, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: fix 2 "unused variables" warnings in drivers/mtd/nand/cafe_nand.c

Hello,

this patch should fix 2 compiler warnings about unused variables if CONFIG_MTD_PARTITIONS is undefined.

---

drivers/mtd/nand/cafe_nand.c +3 -2
index da6ceaa..f1443f0 100644
@@ -626,9 +626,7 @@ 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;
 
        /* Very old versions shared the same PCI ident for all three
@@ -800,6 +798,9 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
        add_mtd_device(mtd);
 
 #ifdef CONFIG_MTD_PARTITIONS
+       struct mtd_partition *parts;
+       int nr_parts;
+
        nr_parts = parse_mtd_partitions(mtd, part_probes, &parts, 0);
        if (nr_parts > 0) {
                cafe->parts = parts;
Signature · 4 lines
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
#1 lore raw
Quoted 13 lines · * Toralf F?rster | 2008-05-26 13:47:51 [+0200]:
drivers/mtd/nand/cafe_nand.c +0 -2
@@ -626,9 +626,7 @@ 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;
 
       /* Very old versions shared the same PCI ident for all three

drivers/mtd/nand/cafe_nand.c static int __devinit cafe_nand_probe(struct pci_dev *pdev, · line 803

Quoted 6 lines
drivers/mtd/nand/cafe_nand.c +3 -0
@@ -800,6 +798,9 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
       add_mtd_device(mtd);
 
 #ifdef CONFIG_MTD_PARTITIONS
+       struct mtd_partition *parts;
+       int nr_parts;
+

You can't declare variables in the middle of the code, can you?

drivers/mtd/nand/cafe_nand.c static int __devinit cafe_nand_probe(struct pci_dev *pdev, · line 806

Quoted 3 lines
drivers/mtd/nand/cafe_nand.c +0 -0
       nr_parts = parse_mtd_partitions(mtd, part_probes, &parts, 0);
       if (nr_parts > 0) {
               cafe->parts = parts;

Sebastian