mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jirka Pirko <jirka@pirko.cz>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org
Subject: [PATCH] get rid of some "may be used uninitialized" compiler warnings
Date: Sat, 29 Nov 2008 00:33:47 +0100	[thread overview]
Message-ID: <20081129003347.2295622f@jirka.pirko.cz> (raw)

Just used uninitialized_var() macro when it's appropriate. I checked
that warning is meaningless in all these cases.

Signed-off-by: Jirka Pirko <jirka@pirko.cz>
---
 arch/x86/kernel/cpu/mtrr/main.c |    2 +-
 drivers/ata/sata_via.c          |    2 +-
 drivers/net/niu.c               |    4 ++--
 drivers/video/aty/aty128fb.c    |    2 +-
 kernel/cpuset.c                 |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index c78c048..c94c0ef 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -1361,7 +1361,7 @@ static int __init mtrr_cleanup(unsigned address_bits)
 	memset(result, 0, sizeof(result));
 	for (gran_size = (1ULL<<16); gran_size < (1ULL<<32); gran_size <<= 1) {
 		char gran_factor;
-		unsigned long gran_base;
+		unsigned long uninitialized_var(gran_base);
 
 		if (debug_print)
 			gran_base = to_size_factor(gran_size >> 10, &gran_factor);
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index c18935f..01df26b 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -564,7 +564,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	static int printed_version;
 	unsigned int i;
 	int rc;
-	struct ata_host *host;
+	struct ata_host *uninitialized_var(host);
 	int board_id = (int) ent->driver_data;
 	const unsigned *bar_sizes;
 
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 1b6f548..0d88aa0 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -448,7 +448,7 @@ static int serdes_init_niu_1g_serdes(struct niu *np)
 	struct niu_link_config *lp = &np->link_config;
 	u16 pll_cfg, pll_sts;
 	int max_retry = 100;
-	u64 sig, mask, val;
+	u64 uninitialized_var(sig), mask, val;
 	u32 tx_cfg, rx_cfg;
 	unsigned long i;
 	int err;
@@ -547,7 +547,7 @@ static int serdes_init_niu_10g_serdes(struct niu *np)
 	struct niu_link_config *lp = &np->link_config;
 	u32 tx_cfg, rx_cfg, pll_cfg, pll_sts;
 	int max_retry = 100;
-	u64 sig, mask, val;
+	u64 uninitialized_var(sig), mask, val;
 	unsigned long i;
 	int err;
 
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 243ea4a..7364610 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1326,7 +1326,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
 {
 	const struct aty128_constants c = par->constants;
 	unsigned char post_dividers[] = {1,2,4,8,3,6,12};
-	u32 output_freq;
+	u32 uninitialized_var(output_freq);
 	u32 vclk;        /* in .01 MHz */
 	int i = 0;
 	u32 n, d;
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index da7ff61..0a58fa0 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -585,7 +585,7 @@ static int generate_sched_domains(cpumask_t **domains,
 	int i, j, k;		/* indices for partition finding loops */
 	cpumask_t *doms;	/* resulting partition; i.e. sched domains */
 	struct sched_domain_attr *dattr;  /* attributes for custom domains */
-	int ndoms;		/* number of sched domains in result */
+	int uninitialized_var(ndoms);		/* number of sched domains in result */
 	int nslot;		/* next empty doms[] cpumask_t slot */
 
 	doms = NULL;
-- 
1.5.4.3


             reply	other threads:[~2008-11-28 23:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-28 23:33 Jirka Pirko [this message]
2008-11-29  9:26 ` Ingo Molnar
2008-11-29  9:39   ` Andrew Morton
2008-11-29 10:13     ` Ingo Molnar

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=20081129003347.2295622f@jirka.pirko.cz \
    --to=jirka@pirko.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@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 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®