[PATCH] Cyclades: Avoid label defined but not used warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(-)

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:


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux