aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2015-09-04 18:43:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-04 19:54:41 -0400
commitd40e1e6532efbb40f8fc1f5af093063a3d186754 (patch)
tree9e037961e86f034ec81f19cb4a466a9bdf36462b /scripts/kernel-doc
parentc22b6ae69ee93c1ecc6821847a8542163fbf3e1a (diff)
kerneldoc: Convert error messages to GNU error message format
Editors like emacs and vi recognize a number of error message formats. The format used by the kerneldoc tool is not recognized by emacs. Change the kerneldoc error message format to the GNU style such that the emacs prev-error and next-error commands can be used to navigate through kerneldoc error messages. For more information about the GNU error message format, see also https://www.gnu.org/prep/standards/html_node/Errors.html. This patch has been generated via the following sed command: sed -i.orig 's/Error(\${file}:\$.):/\${file}:\$.: error:/g;s/Warning(\${file}:\$.):/\${file}:\$.: warning:/g;s/Warning(\${file}):/\${file}:1: warning:/g;s/Info(\${file}:\$.):/\${file}:\$.: info:/g' scripts/kernel-doc Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Cc: Johannes Berg <johannes.berg@intel.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc38
1 files changed, 19 insertions, 19 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index a7bf5f68aacb..9a08fb5c1af6 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -469,7 +469,7 @@ sub dump_section {
469 } else { 469 } else {
470# print STDERR "other section '$name' = '$contents'\n"; 470# print STDERR "other section '$name' = '$contents'\n";
471 if (defined($sections{$name}) && ($sections{$name} ne "")) { 471 if (defined($sections{$name}) && ($sections{$name} ne "")) {
472 print STDERR "Error(${file}:$.): duplicate section name '$name'\n"; 472 print STDERR "${file}:$.: error: duplicate section name '$name'\n";
473 ++$errors; 473 ++$errors;
474 } 474 }
475 $sections{$name} = $contents; 475 $sections{$name} = $contents;
@@ -1820,7 +1820,7 @@ sub dump_struct($$) {
1820 }); 1820 });
1821 } 1821 }
1822 else { 1822 else {
1823 print STDERR "Error(${file}:$.): Cannot parse struct or union!\n"; 1823 print STDERR "${file}:$.: error: Cannot parse struct or union!\n";
1824 ++$errors; 1824 ++$errors;
1825 } 1825 }
1826} 1826}
@@ -1841,7 +1841,7 @@ sub dump_enum($$) {
1841 push @parameterlist, $arg; 1841 push @parameterlist, $arg;
1842 if (!$parameterdescs{$arg}) { 1842 if (!$parameterdescs{$arg}) {
1843 $parameterdescs{$arg} = $undescribed; 1843 $parameterdescs{$arg} = $undescribed;
1844 print STDERR "Warning(${file}:$.): Enum value '$arg' ". 1844 print STDERR "${file}:$.: warning: Enum value '$arg' ".
1845 "not described in enum '$declaration_name'\n"; 1845 "not described in enum '$declaration_name'\n";
1846 } 1846 }
1847 1847
@@ -1859,7 +1859,7 @@ sub dump_enum($$) {
1859 }); 1859 });
1860 } 1860 }
1861 else { 1861 else {
1862 print STDERR "Error(${file}:$.): Cannot parse enum!\n"; 1862 print STDERR "${file}:$.: error: Cannot parse enum!\n";
1863 ++$errors; 1863 ++$errors;
1864 } 1864 }
1865} 1865}
@@ -1887,7 +1887,7 @@ sub dump_typedef($$) {
1887 }); 1887 });
1888 } 1888 }
1889 else { 1889 else {
1890 print STDERR "Error(${file}:$.): Cannot parse typedef!\n"; 1890 print STDERR "${file}:$.: error: Cannot parse typedef!\n";
1891 ++$errors; 1891 ++$errors;
1892 } 1892 }
1893} 1893}
@@ -2019,11 +2019,11 @@ sub push_parameter($$$) {
2019 $parameterdescs{$param_name} = $undescribed; 2019 $parameterdescs{$param_name} = $undescribed;
2020 2020
2021 if (($type eq 'function') || ($type eq 'enum')) { 2021 if (($type eq 'function') || ($type eq 'enum')) {
2022 print STDERR "Warning(${file}:$.): Function parameter ". 2022 print STDERR "${file}:$.: warning: Function parameter ".
2023 "or member '$param' not " . 2023 "or member '$param' not " .
2024 "described in '$declaration_name'\n"; 2024 "described in '$declaration_name'\n";
2025 } 2025 }
2026 print STDERR "Warning(${file}:$.):" . 2026 print STDERR "${file}:$.: warning:" .
2027 " No description found for parameter '$param'\n"; 2027 " No description found for parameter '$param'\n";
2028 ++$warnings; 2028 ++$warnings;
2029 } 2029 }
@@ -2074,14 +2074,14 @@ sub check_sections($$$$$$) {
2074 } 2074 }
2075 if ($err) { 2075 if ($err) {
2076 if ($decl_type eq "function") { 2076 if ($decl_type eq "function") {
2077 print STDERR "Warning(${file}:$.): " . 2077 print STDERR "${file}:$.: warning: " .
2078 "Excess function parameter " . 2078 "Excess function parameter " .
2079 "'$sects[$sx]' " . 2079 "'$sects[$sx]' " .
2080 "description in '$decl_name'\n"; 2080 "description in '$decl_name'\n";
2081 ++$warnings; 2081 ++$warnings;
2082 } else { 2082 } else {
2083 if ($nested !~ m/\Q$sects[$sx]\E/) { 2083 if ($nested !~ m/\Q$sects[$sx]\E/) {
2084 print STDERR "Warning(${file}:$.): " . 2084 print STDERR "${file}:$.: warning: " .
2085 "Excess struct/union/enum/typedef member " . 2085 "Excess struct/union/enum/typedef member " .
2086 "'$sects[$sx]' " . 2086 "'$sects[$sx]' " .
2087 "description in '$decl_name'\n"; 2087 "description in '$decl_name'\n";
@@ -2107,7 +2107,7 @@ sub check_return_section {
2107 2107
2108 if (!defined($sections{$section_return}) || 2108 if (!defined($sections{$section_return}) ||
2109 $sections{$section_return} eq "") { 2109 $sections{$section_return} eq "") {
2110 print STDERR "Warning(${file}:$.): " . 2110 print STDERR "${file}:$.: warning: " .
2111 "No description found for return value of " . 2111 "No description found for return value of " .
2112 "'$declaration_name'\n"; 2112 "'$declaration_name'\n";
2113 ++$warnings; 2113 ++$warnings;
@@ -2186,7 +2186,7 @@ sub dump_function($$) {
2186 2186
2187 create_parameterlist($args, ',', $file); 2187 create_parameterlist($args, ',', $file);
2188 } else { 2188 } else {
2189 print STDERR "Warning(${file}:$.): cannot understand function prototype: '$prototype'\n"; 2189 print STDERR "${file}:$.: warning: cannot understand function prototype: '$prototype'\n";
2190 return; 2190 return;
2191 } 2191 }
2192 2192
@@ -2251,7 +2251,7 @@ sub tracepoint_munge($) {
2251 $tracepointargs = $1; 2251 $tracepointargs = $1;
2252 } 2252 }
2253 if (($tracepointname eq 0) || ($tracepointargs eq 0)) { 2253 if (($tracepointname eq 0) || ($tracepointargs eq 0)) {
2254 print STDERR "Warning(${file}:$.): Unrecognized tracepoint format: \n". 2254 print STDERR "${file}:$.: warning: Unrecognized tracepoint format: \n".
2255 "$prototype\n"; 2255 "$prototype\n";
2256 } else { 2256 } else {
2257 $prototype = "static inline void trace_$tracepointname($tracepointargs)"; 2257 $prototype = "static inline void trace_$tracepointname($tracepointargs)";
@@ -2450,7 +2450,7 @@ sub process_file($) {
2450 } 2450 }
2451 2451
2452 if (($declaration_purpose eq "") && $verbose) { 2452 if (($declaration_purpose eq "") && $verbose) {
2453 print STDERR "Warning(${file}:$.): missing initial short description on line:\n"; 2453 print STDERR "${file}:$.: warning: missing initial short description on line:\n";
2454 print STDERR $_; 2454 print STDERR $_;
2455 ++$warnings; 2455 ++$warnings;
2456 } 2456 }
@@ -2468,10 +2468,10 @@ sub process_file($) {
2468 } 2468 }
2469 2469
2470 if ($verbose) { 2470 if ($verbose) {
2471 print STDERR "Info(${file}:$.): Scanning doc for $identifier\n"; 2471 print STDERR "${file}:$.: info: Scanning doc for $identifier\n";
2472 } 2472 }
2473 } else { 2473 } else {
2474 print STDERR "Warning(${file}:$.): Cannot understand $_ on line $.", 2474 print STDERR "${file}:$.: warning: Cannot understand $_ on line $.",
2475 " - I thought it was a doc line\n"; 2475 " - I thought it was a doc line\n";
2476 ++$warnings; 2476 ++$warnings;
2477 $state = 0; 2477 $state = 0;
@@ -2483,7 +2483,7 @@ sub process_file($) {
2483 2483
2484 if (($contents ne "") && ($contents ne "\n")) { 2484 if (($contents ne "") && ($contents ne "\n")) {
2485 if (!$in_doc_sect && $verbose) { 2485 if (!$in_doc_sect && $verbose) {
2486 print STDERR "Warning(${file}:$.): contents before sections\n"; 2486 print STDERR "${file}:$.: warning: contents before sections\n";
2487 ++$warnings; 2487 ++$warnings;
2488 } 2488 }
2489 dump_section($file, $section, xml_escape($contents)); 2489 dump_section($file, $section, xml_escape($contents));
@@ -2509,7 +2509,7 @@ sub process_file($) {
2509 } 2509 }
2510 # look for doc_com + <text> + doc_end: 2510 # look for doc_com + <text> + doc_end:
2511 if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') { 2511 if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') {
2512 print STDERR "Warning(${file}:$.): suspicious ending line: $_"; 2512 print STDERR "${file}:$.: warning: suspicious ending line: $_";
2513 ++$warnings; 2513 ++$warnings;
2514 } 2514 }
2515 2515
@@ -2539,7 +2539,7 @@ sub process_file($) {
2539 } 2539 }
2540 } else { 2540 } else {
2541 # i dont know - bad line? ignore. 2541 # i dont know - bad line? ignore.
2542 print STDERR "Warning(${file}:$.): bad line: $_"; 2542 print STDERR "${file}:$.: warning: bad line: $_";
2543 ++$warnings; 2543 ++$warnings;
2544 } 2544 }
2545 } elsif ($state == 5) { # scanning for split parameters 2545 } elsif ($state == 5) { # scanning for split parameters
@@ -2631,7 +2631,7 @@ sub process_file($) {
2631 } 2631 }
2632 } 2632 }
2633 if ($initial_section_counter == $section_counter) { 2633 if ($initial_section_counter == $section_counter) {
2634 print STDERR "Warning(${file}): no structured comments found\n"; 2634 print STDERR "${file}:1: warning: no structured comments found\n";
2635 if (($function_only == 1) && ($show_not_found == 1)) { 2635 if (($function_only == 1) && ($show_not_found == 1)) {
2636 print STDERR " Was looking for '$_'.\n" for keys %function_table; 2636 print STDERR " Was looking for '$_'.\n" for keys %function_table;
2637 } 2637 }