[prev in list] [next in list] [prev in thread] [next in thread]
List: git-commits-head
Subject: sched, cpusets: fix warning in kernel/cpuset.c
From: Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date: 2008-11-30 22:00:45
Message-ID: 200811302200.mAUM0jpT004709 () hera ! kernel ! org
[Download RAW message or body]
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1583715ddb61f822041807a0f18b3b4845e88c76
Commit: 1583715ddb61f822041807a0f18b3b4845e88c76
Parent: 4cd4262034849da01eb88659af677b69f8169f06
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Tue Nov 25 10:27:49 2008 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sat Nov 29 20:39:29 2008 +0100
sched, cpusets: fix warning in kernel/cpuset.c
this warning:
kernel/cpuset.c: In function ‘generate_sched_domains':
kernel/cpuset.c:588: warning: ‘ndoms' may be used uninitialized in this function
triggers because GCC does not recognize that ndoms stays uninitialized
only if doms is NULL - but that flow is covered at the end of
generate_sched_domains().
Help out GCC by initializing this variable to 0. (that's prudent anyway)
Also, this function needs a splitup and code flow simplification:
with 160 lines length it's clearly too long.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/cpuset.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index da7ff61..96c0ba1 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 ndoms = 0; /* number of sched domains in result */
int nslot; /* next empty doms[] cpumask_t slot */
doms = NULL;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic