diff mbox

[2/5] kconfig/conf: reduce the scope of `defconfig_file'

Message ID 1309583440-4795-3-git-send-email-lacombar@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arnaud Lacombe July 2, 2011, 5:10 a.m. UTC
This variable is not used outside of main() so there is not much reason keeping
it global. Ensure it is initialized as gcc has no way to know that normal
execution path expect only one option switch to be given on the command line
(except when we request help). As a result, we always initialize
`defconfig_file' before using it.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
---
 scripts/kconfig/conf.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 08c05bc..6431f5c 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -34,8 +34,6 @@  enum input_mode {
 	oldnoconfig,
 } input_mode = oldaskconfig;
 
-char *defconfig_file;
-
 static int indent = 1;
 static int valid_stdin = 1;
 static int sync_kconfig;
@@ -462,7 +460,7 @@  static struct option long_opts[] = {
 int main(int ac, char **av)
 {
 	int opt;
-	const char *name;
+	const char *name, *defconfig_file = NULL /* gcc uninit */;
 	struct stat tmpstat;
 
 	setlocale(LC_ALL, "");