diff options
| author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-02-18 05:19:25 +0300 |
|---|---|---|
| committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-02-18 05:19:25 +0300 |
| commit | 82a0a1cc8f94bc59e5919715bc03fc8353fa770d (patch) | |
| tree | c25f19a0ae1f7cb75319b585c1d473cfed463f22 /scripts/kernel-doc | |
| parent | 8d30c14cab30d405a05f2aaceda1e9ad57800f36 (diff) | |
| parent | 5955c7a2cfb6a35429adea5dc480002b15ca8cfc (diff) | |
| download | linux-82a0a1cc8f94bc59e5919715bc03fc8353fa770d.tar.xz | |
Merge commit 'origin/master' into next
Manual merge of:
arch/powerpc/include/asm/pgtable-ppc32.h
Diffstat (limited to 'scripts/kernel-doc')
| -rwxr-xr-x | scripts/kernel-doc | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 8bb83a100edb..0f11870116dc 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1827,6 +1827,40 @@ sub reset_state { $state = 0; } +sub syscall_munge() { + my $void = 0; + + $prototype =~ s@[\r\n\t]+@ @gos; # strip newlines/CR's/tabs +## if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) { + if ($prototype =~ m/SYSCALL_DEFINE0/) { + $void = 1; +## $prototype = "long sys_$1(void)"; + } + + $prototype =~ s/SYSCALL_DEFINE.*\(/long sys_/; # fix return type & func name + if ($prototype =~ m/long (sys_.*?),/) { + $prototype =~ s/,/\(/; + } elsif ($void) { + $prototype =~ s/\)/\(void\)/; + } + + # now delete all of the odd-number commas in $prototype + # so that arg types & arg names don't have a comma between them + my $count = 0; + my $len = length($prototype); + if ($void) { + $len = 0; # skip the for-loop + } + for (my $ix = 0; $ix < $len; $ix++) { + if (substr($prototype, $ix, 1) eq ',') { + $count++; + if ($count % 2 == 1) { + substr($prototype, $ix, 1) = ' '; + } + } + } +} + sub process_state3_function($$) { my $x = shift; my $file = shift; @@ -1839,11 +1873,15 @@ sub process_state3_function($$) { elsif ($x =~ /([^\{]*)/) { $prototype .= $1; } + if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) { $prototype =~ s@/\*.*?\*/@@gos; # strip comments. $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. $prototype =~ s@^\s+@@gos; # strip leading spaces - dump_function($prototype,$file); + if ($prototype =~ /SYSCALL_DEFINE/) { + syscall_munge(); + } + dump_function($prototype, $file); reset_state(); } } |
