All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Millan <jessem@cs.pdx.edu>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] Fix GCC warning: unused variable
Date: Fri, 24 Jun 2005 19:39:57 +0000	[thread overview]
Message-ID: <42BC618D.7070704@cs.pdx.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]


This function will return either 'eisacount', 'pcicount' or 0. Because
of the control flow, one, or both the variables will be unused.
Replacing them with one generic variable 'count' instead of the two is
more efficient and eliminates the unused variable warning.


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 950 bytes --]

Signed-off-by: Jesse Millan <jessem@cs.pdx.edu>

--- linux-2.6.12-rc6.kj/drivers/net/dgrs.c~	2005-06-24 12:05:17.748053320 -0700
+++ linux-2.6.12-rc6.kj/drivers/net/dgrs.c	2005-06-24 12:20:34.474689688 -0700
@@ -1549,7 +1549,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
 static int __init dgrs_init_module (void)
 {
 	int	i;
-	int eisacount = 0, pcicount = 0;
+	int count = 0;

 	/*
 	 *	Command line variable overrides
@@ -1591,14 +1591,14 @@ static int __init dgrs_init_module (void
 	 *	Find and configure all the cards
 	 */
 #ifdef CONFIG_EISA
-	eisacount = eisa_driver_register(&dgrs_eisa_driver);
-	if (eisacount < 0)
-		return eisacount;
+	count = eisa_driver_register(&dgrs_eisa_driver);
+	if (count < 0)
+		return count;
 #endif
 #ifdef CONFIG_PCI
-	pcicount = pci_register_driver(&dgrs_pci_driver);
-	if (pcicount)
-		return pcicount;
+	count = pci_register_driver(&dgrs_pci_driver);
+	if (count)
+		return count;
 #endif
 	return 0;
 }


[-- Attachment #3: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

             reply	other threads:[~2005-06-24 19:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24 19:39 Jesse Millan [this message]
2005-06-28 13:55 ` [KJ] [PATCH] Fix GCC warning: unused variable Domen Puncer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42BC618D.7070704@cs.pdx.edu \
    --to=jessem@cs.pdx.edu \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.