lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87iktusfy0.fsf@trenco.lwn.net>
Date: Mon, 14 Oct 2024 12:21:59 -0600
From: Jonathan Corbet <corbet@....net>
To: Chen-Yu Tsai <wenst@...omium.org>
Cc: Chen-Yu Tsai <wenst@...omium.org>, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scripts/kernel-doc: Do not track section counter across
 processed files

Chen-Yu Tsai <wenst@...omium.org> writes:

> The section counter tracks how many sections of kernel-doc were added.
> The only real use of the counter value is to check if anything was
> actually supposed to be output and give a warning is nothing is
> available.
>
> The current logic of remembering the initial value and then resetting
> the value then when processing each file means that if a file has the
> same number of sections as the previously processed one, a warning is
> incorrectly given.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Chen-Yu Tsai <wenst@...omium.org>
> ---
> Found this while improving and checking the kernel docs for the
> regulator core.
>
>  scripts/kernel-doc | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 2791f8195203..c608820f0bf5 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -2322,7 +2322,6 @@ sub process_inline($$) {
>  
>  sub process_file($) {
>      my $file;
> -    my $initial_section_counter = $section_counter;
>      my ($orig_file) = @_;
>  
>      $file = map_filename($orig_file);
> @@ -2360,8 +2359,7 @@ sub process_file($) {
>      }
>  
>      # Make sure we got something interesting.
> -    if ($initial_section_counter == $section_counter && $
> -        output_mode ne "none") {
> +    if (!$section_counter && $output_mode ne "none") {
>          if ($output_selection == OUTPUT_INCLUDE) {
>              emit_warning("${file}:1", "'$_' not found\n")
>                  for keys %function_table;

So I am curious, have you actually seen a spurious warning from this?  A
normal build does not emit any here.

The current logic is indeed screwy, I'll apply this fix.  But
$section_counter kind of seems like a holdover from the docbook days and
maybe isn't needed at all anymore?

Thanks,

jon

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ