* [PATCH] Cyclades: Avoid label defined but not used warning
@ 2007-08-17 21:05 Jesper Juhl
0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2007-08-17 21:05 UTC (permalink / raw)
To: Marcio Saito
Cc: Randolph Bentson, Jiri Slaby, Arnaldo Carvalho de Melo,
Jesper Juhl, Linux Kernel Mailing List
Hi,
I don't like compiler warnings, especially not when they are easy to
avoid.
Building cyclades driver without CONFIG_PCI currently results in this :
CC drivers/char/cyclades.o
drivers/char/cyclades.c: In function 'cy_init':
drivers/char/cyclades.c:5488: warning: label 'err_unr' defined but not used
That's easily avoided, with no ill effects by simply moving what's
under the 'err_unr' label (used from only a single location) inside
the existing #ifdef - so that's what this patch does.
Compile tested on i386 only. I don't have the hardware to do any
other testing.
Please consider applying.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
drivers/char/cyclades.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 9e0adfe..858bdab 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -5480,13 +5480,13 @@ static int __init cy_init(void)
#ifdef CONFIG_PCI
/* look for pci boards */
retval = pci_register_driver(&cy_pci_driver);
- if (retval && !nboards)
- goto err_unr;
+ if (retval && !nboards) {
+ tty_unregister_driver(cy_serial_driver);
+ goto err_frtty;
+ }
#endif
return 0;
-err_unr:
- tty_unregister_driver(cy_serial_driver);
err_frtty:
put_tty_driver(cy_serial_driver);
err:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-17 21:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-17 21:05 [PATCH] Cyclades: Avoid label defined but not used warning Jesper Juhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome