diff options
| author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-18 07:30:18 -0500 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2017-12-21 15:41:47 -0500 |
| commit | 2defb27292176959da02f1ba32940870dd1814eb (patch) | |
| tree | 0704c9dd2b795c91e7fbecdb9374755c5343bf86 /scripts/kernel-doc | |
| parent | 84ce5b987783d362ee4e737b653d6e2feacfa40c (diff) | |
scripts: kernel-doc: apply filtering rules to warnings
When kernel-doc is called with output selection filters,
it will be called lots of time for a single file. If
there is a warning present there, it means that it may
print hundreds of identical warnings.
Worse than that, the -function NAME actually filters only
functions. So, it makes no sense at all to print warnings
for structs or enums.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/kernel-doc')
| -rwxr-xr-x | scripts/kernel-doc | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0bda21d9d3f2..1e2b35ce1c9d 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -1160,16 +1160,26 @@ sub dump_enum($$) { | |||
| 1160 | push @parameterlist, $arg; | 1160 | push @parameterlist, $arg; |
| 1161 | if (!$parameterdescs{$arg}) { | 1161 | if (!$parameterdescs{$arg}) { |
| 1162 | $parameterdescs{$arg} = $undescribed; | 1162 | $parameterdescs{$arg} = $undescribed; |
| 1163 | print STDERR "${file}:$.: warning: Enum value '$arg' ". | 1163 | if (($output_selection == OUTPUT_ALL) || |
| 1164 | "not described in enum '$declaration_name'\n"; | 1164 | ($output_selection == OUTPUT_INCLUDE && |
| 1165 | defined($function_table{$declaration_name})) || | ||
| 1166 | ($output_selection == OUTPUT_EXCLUDE && | ||
| 1167 | !defined($function_table{$declaration_name}))) { | ||
| 1168 | print STDERR "${file}:$.: warning: Enum value '$arg' not described in enum '$declaration_name'\n"; | ||
| 1169 | } | ||
| 1165 | } | 1170 | } |
| 1166 | $_members{$arg} = 1; | 1171 | $_members{$arg} = 1; |
| 1167 | } | 1172 | } |
| 1168 | 1173 | ||
| 1169 | while (my ($k, $v) = each %parameterdescs) { | 1174 | while (my ($k, $v) = each %parameterdescs) { |
| 1170 | if (!exists($_members{$k})) { | 1175 | if (!exists($_members{$k})) { |
| 1171 | print STDERR "${file}:$.: warning: Excess enum value " . | 1176 | if (($output_selection == OUTPUT_ALL) || |
| 1172 | "'$k' description in '$declaration_name'\n"; | 1177 | ($output_selection == OUTPUT_INCLUDE && |
| 1178 | defined($function_table{$declaration_name})) || | ||
| 1179 | ($output_selection == OUTPUT_EXCLUDE && | ||
| 1180 | !defined($function_table{$declaration_name}))) { | ||
| 1181 | print STDERR "${file}:$.: warning: Excess enum value '$k' description in '$declaration_name'\n"; | ||
| 1182 | } | ||
| 1173 | } | 1183 | } |
| 1174 | } | 1184 | } |
| 1175 | 1185 | ||
| @@ -1375,9 +1385,15 @@ sub push_parameter($$$$) { | |||
| 1375 | if (!defined $parameterdescs{$param} && $param !~ /^#/) { | 1385 | if (!defined $parameterdescs{$param} && $param !~ /^#/) { |
| 1376 | $parameterdescs{$param} = $undescribed; | 1386 | $parameterdescs{$param} = $undescribed; |
| 1377 | 1387 | ||
| 1378 | print STDERR | 1388 | if (($output_selection == OUTPUT_ALL) || |
| 1379 | "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n"; | 1389 | ($output_selection == OUTPUT_INCLUDE && |
| 1380 | ++$warnings; | 1390 | defined($function_table{$declaration_name})) || |
| 1391 | ($output_selection == OUTPUT_EXCLUDE && | ||
| 1392 | !defined($function_table{$declaration_name}))) { | ||
| 1393 | print STDERR | ||
| 1394 | "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n"; | ||
| 1395 | ++$warnings; | ||
| 1396 | } | ||
| 1381 | } | 1397 | } |
| 1382 | 1398 | ||
| 1383 | $param = xml_escape($param); | 1399 | $param = xml_escape($param); |
