* [PATCH] MTD: fix 2 "unused variables" warnings in drivers/mtd/nand/cafe_nand.c
@ 2008-05-26 11:47 Toralf Förster
2008-05-26 11:58 ` Sebastian Siewior
0 siblings, 1 reply; 2+ messages in thread
From: Toralf Förster @ 2008-05-26 11:47 UTC (permalink / raw)
To: dwmw2, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]
Hello,
this patch should fix 2 compiler warnings about unused variables
if CONFIG_MTD_PARTITIONS is undefined.
Signed-off-by: Toralf Förster <toralf.foerster@gmx.de>
---
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index da6ceaa..f1443f0 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -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;
--
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] MTD: fix 2 "unused variables" warnings in drivers/mtd/nand/cafe_nand.c
2008-05-26 11:47 [PATCH] MTD: fix 2 "unused variables" warnings in drivers/mtd/nand/cafe_nand.c Toralf Förster
@ 2008-05-26 11:58 ` Sebastian Siewior
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Siewior @ 2008-05-26 11:58 UTC (permalink / raw)
To: Toralf F?rster; +Cc: dwmw2, linux-kernel
* Toralf F?rster | 2008-05-26 13:47:51 [+0200]:
>--- a/drivers/mtd/nand/cafe_nand.c
>+++ b/drivers/mtd/nand/cafe_nand.c
>@@ -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;
>+
You can't declare variables in the middle of the code, can you?
> nr_parts = parse_mtd_partitions(mtd, part_probes, &parts, 0);
> if (nr_parts > 0) {
> cafe->parts = parts;
Sebastian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-26 11:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-26 11:47 [PATCH] MTD: fix 2 "unused variables" warnings in drivers/mtd/nand/cafe_nand.c Toralf Förster
2008-05-26 11:58 ` Sebastian Siewior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®