projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge 3.5-rc5 into usb-next
[cascardo/linux.git]
/
arch
/
x86
/
kernel
/
cpu
/
mkcapflags.pl
diff --git
a/arch/x86/kernel/cpu/mkcapflags.pl
b/arch/x86/kernel/cpu/mkcapflags.pl
index
dfea390
..
c7b3fe2
100644
(file)
--- a/
arch/x86/kernel/cpu/mkcapflags.pl
+++ b/
arch/x86/kernel/cpu/mkcapflags.pl
@@
-1,4
+1,4
@@
-#!/usr/bin/perl
+#!/usr/bin/perl
-w
#
# Generate the x86_cap_flags[] array from include/asm-x86/cpufeature.h
#
#
# Generate the x86_cap_flags[] array from include/asm-x86/cpufeature.h
#
@@
-11,22
+11,35
@@
open(OUT, "> $out\0") or die "$0: cannot create: $out: $!\n";
print OUT "#include <asm/cpufeature.h>\n\n";
print OUT "const char * const x86_cap_flags[NCAPINTS*32] = {\n";
print OUT "#include <asm/cpufeature.h>\n\n";
print OUT "const char * const x86_cap_flags[NCAPINTS*32] = {\n";
+%features = ();
+$err = 0;
+
while (defined($line = <IN>)) {
if ($line =~ /^\s*\#\s*define\s+(X86_FEATURE_(\S+))\s+(.*)$/) {
$macro = $1;
while (defined($line = <IN>)) {
if ($line =~ /^\s*\#\s*define\s+(X86_FEATURE_(\S+))\s+(.*)$/) {
$macro = $1;
- $feature =
$2
;
+ $feature =
"\L$2"
;
$tail = $3;
if ($tail =~ /\/\*\s*\"([^"]*)\".*\*\//) {
$tail = $3;
if ($tail =~ /\/\*\s*\"([^"]*)\".*\*\//) {
- $feature =
$1
;
+ $feature =
"\L$1"
;
}
}
- if ($feature ne '') {
- printf OUT "\t%-32s = \"%s\",\n",
- "[$macro]", "\L$feature";
+ next if ($feature eq '');
+
+ if ($features{$feature}++) {
+ print STDERR "$in: duplicate feature name: $feature\n";
+ $err++;
}
}
+ printf OUT "\t%-32s = \"%s\",\n", "[$macro]", $feature;
}
}
print OUT "};\n";
close(IN);
close(OUT);
}
}
print OUT "};\n";
close(IN);
close(OUT);
+
+if ($err) {
+ unlink($out);
+ exit(1);
+}
+
+exit(0);