Cyclades: Avoid label defined but not used warning
PATCH 1/1 Cyclades: Avoid label defined but not used warning
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 <[email protected]>
---
drivers/char/cyclades.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/char/cyclades.c +4 -4
@@ -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: