From e36b7b260ab8cee00f043cfcd64a4bec046997df Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 12 Jun 2006 17:03:58 -0300 Subject: Hex option defaults weren't handled correct in make_kconfig From: Trent Piepho The regex for int and hex option defaults was only correct for int options, it didn't handle hex characters. The kernel version code was outputing "default n" lines for disabled hex and int options, it should only be done for boolean and tristate options. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 0d396c8f4..228e0aa48 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -32,7 +32,7 @@ sub add_int($) { my $arg=shift; - exists $config{$arg} or die "Adding unknown int '$arg'"; + exists $config{$arg} or die "Adding unknown int/hex '$arg'"; $intopt{$arg} = 0; } @@ -41,7 +41,7 @@ sub set_int_value($$) my $key = shift; my $val = shift; - exists $intopt{$key} or die "Default for unknown int option '$key'"; + exists $intopt{$key} or die "Default for unknown int/hex option '$key'"; $intopt{$key} = $val; } @@ -124,7 +124,7 @@ sub open_kconfig($$) { add_int($key); } # Get default for int options - if (m|^\s+default "(\d+)"| && exists $intopt{$key}) { + if (m|^\s+default "([[:xdigit:]]+)"| && exists $intopt{$key}) { set_int_value($key, $1); } # Override default for disabled tri/bool options @@ -138,7 +138,9 @@ sub open_kconfig($$) { # we need to make sure we've disabled it, and add a bit # to the help text if (m|^\s*(---)?help(---)?\s*$| && $disabled) { - print OUT "\tdefault n\n" unless($default_seen); + if(exists $tristate{$key} && !$default_seen) { + print OUT "\tdefault n\n"; + } print OUT <<"EOF"; depends on VIDEO_KERNEL_VERSION help -- cgit v1.2.3