Skip to content

Commit d40e1e6

Browse files
Bart Van Asschetorvalds
authored andcommitted
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>
1 parent c22b6ae commit d40e1e6

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

‎scripts/kernel-doc‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ sub dump_section {
469469
} else {
470470
# print STDERR "other section '$name' = '$contents'\n";
471471
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";
473473
++$errors;
474474
}
475475
$sections{$name} = $contents;
@@ -1820,7 +1820,7 @@ sub dump_struct($$) {
18201820
});
18211821
}
18221822
else {
1823-
print STDERR "Error(${file}:$.): Cannot parse struct or union!\n";
1823+
print STDERR "${file}:$.: error: Cannot parse struct or union!\n";
18241824
++$errors;
18251825
}
18261826
}
@@ -1841,7 +1841,7 @@ sub dump_enum($$) {
18411841
push @parameterlist, $arg;
18421842
if (!$parameterdescs{$arg}) {
18431843
$parameterdescs{$arg} = $undescribed;
1844-
print STDERR "Warning(${file}:$.): Enum value '$arg' ".
1844+
print STDERR "${file}:$.: warning: Enum value '$arg' ".
18451845
"not described in enum '$declaration_name'\n";
18461846
}
18471847

@@ -1859,7 +1859,7 @@ sub dump_enum($$) {
18591859
});
18601860
}
18611861
else {
1862-
print STDERR "Error(${file}:$.): Cannot parse enum!\n";
1862+
print STDERR "${file}:$.: error: Cannot parse enum!\n";
18631863
++$errors;
18641864
}
18651865
}
@@ -1887,7 +1887,7 @@ sub dump_typedef($$) {
18871887
});
18881888
}
18891889
else {
1890-
print STDERR "Error(${file}:$.): Cannot parse typedef!\n";
1890+
print STDERR "${file}:$.: error: Cannot parse typedef!\n";
18911891
++$errors;
18921892
}
18931893
}
@@ -2019,11 +2019,11 @@ sub push_parameter($$$) {
20192019
$parameterdescs{$param_name} = $undescribed;
20202020

20212021
if (($type eq 'function') || ($type eq 'enum')) {
2022-
print STDERR "Warning(${file}:$.): Function parameter ".
2022+
print STDERR "${file}:$.: warning: Function parameter ".
20232023
"or member '$param' not " .
20242024
"described in '$declaration_name'\n";
20252025
}
2026-
print STDERR "Warning(${file}:$.):" .
2026+
print STDERR "${file}:$.: warning:" .
20272027
" No description found for parameter '$param'\n";
20282028
++$warnings;
20292029
}
@@ -2074,14 +2074,14 @@ sub check_sections($$$$$$) {
20742074
}
20752075
if ($err) {
20762076
if ($decl_type eq "function") {
2077-
print STDERR "Warning(${file}:$.): " .
2077+
print STDERR "${file}:$.: warning: " .
20782078
"Excess function parameter " .
20792079
"'$sects[$sx]' " .
20802080
"description in '$decl_name'\n";
20812081
++$warnings;
20822082
} else {
20832083
if ($nested !~ m/\Q$sects[$sx]\E/) {
2084-
print STDERR "Warning(${file}:$.): " .
2084+
print STDERR "${file}:$.: warning: " .
20852085
"Excess struct/union/enum/typedef member " .
20862086
"'$sects[$sx]' " .
20872087
"description in '$decl_name'\n";
@@ -2107,7 +2107,7 @@ sub check_return_section {
21072107

21082108
if (!defined($sections{$section_return}) ||
21092109
$sections{$section_return} eq "") {
2110-
print STDERR "Warning(${file}:$.): " .
2110+
print STDERR "${file}:$.: warning: " .
21112111
"No description found for return value of " .
21122112
"'$declaration_name'\n";
21132113
++$warnings;
@@ -2186,7 +2186,7 @@ sub dump_function($$) {
21862186

21872187
create_parameterlist($args, ',', $file);
21882188
} else {
2189-
print STDERR "Warning(${file}:$.): cannot understand function prototype: '$prototype'\n";
2189+
print STDERR "${file}:$.: warning: cannot understand function prototype: '$prototype'\n";
21902190
return;
21912191
}
21922192

@@ -2251,7 +2251,7 @@ sub tracepoint_munge($) {
22512251
$tracepointargs = $1;
22522252
}
22532253
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".
22552255
"$prototype\n";
22562256
} else {
22572257
$prototype = "static inline void trace_$tracepointname($tracepointargs)";
@@ -2450,7 +2450,7 @@ sub process_file($) {
24502450
}
24512451

24522452
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";
24542454
print STDERR $_;
24552455
++$warnings;
24562456
}
@@ -2468,10 +2468,10 @@ sub process_file($) {
24682468
}
24692469

24702470
if ($verbose) {
2471-
print STDERR "Info(${file}:$.): Scanning doc for $identifier\n";
2471+
print STDERR "${file}:$.: info: Scanning doc for $identifier\n";
24722472
}
24732473
} else {
2474-
print STDERR "Warning(${file}:$.): Cannot understand $_ on line $.",
2474+
print STDERR "${file}:$.: warning: Cannot understand $_ on line $.",
24752475
" - I thought it was a doc line\n";
24762476
++$warnings;
24772477
$state = 0;
@@ -2483,7 +2483,7 @@ sub process_file($) {
24832483

24842484
if (($contents ne "") && ($contents ne "\n")) {
24852485
if (!$in_doc_sect && $verbose) {
2486-
print STDERR "Warning(${file}:$.): contents before sections\n";
2486+
print STDERR "${file}:$.: warning: contents before sections\n";
24872487
++$warnings;
24882488
}
24892489
dump_section($file, $section, xml_escape($contents));
@@ -2509,7 +2509,7 @@ sub process_file($) {
25092509
}
25102510
# look for doc_com + <text> + doc_end:
25112511
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: $_";
25132513
++$warnings;
25142514
}
25152515

@@ -2539,7 +2539,7 @@ sub process_file($) {
25392539
}
25402540
} else {
25412541
# i dont know - bad line? ignore.
2542-
print STDERR "Warning(${file}:$.): bad line: $_";
2542+
print STDERR "${file}:$.: warning: bad line: $_";
25432543
++$warnings;
25442544
}
25452545
} elsif ($state == 5) { # scanning for split parameters
@@ -2631,7 +2631,7 @@ sub process_file($) {
26312631
}
26322632
}
26332633
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";
26352635
if (($function_only == 1) && ($show_not_found == 1)) {
26362636
print STDERR " Was looking for '$_'.\n" for keys %function_table;
26372637
}

0 commit comments

Comments
 (0)