Re: [PATCH 1/9] docs: kdoc: simplify the PROTO continuation logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Fri,  6 Jun 2025 10:34:30 -0600
Jonathan Corbet <corbet@xxxxxxx> escreveu:

> Remove the unneeded "cont" variable and tighten up the code slightly.
> 
> Signed-off-by: Jonathan Corbet <corbet@xxxxxxx>

LGTM.
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>

> ---
>  scripts/lib/kdoc/kdoc_parser.py | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index 062453eefc7a..b193cf9dc0d1 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -1680,7 +1680,6 @@ class KernelDoc:
>          Besides parsing kernel-doc tags, it also parses export symbols.
>          """
>  
> -        cont = False
>          prev = ""
>          prev_ln = None
>          export_table = set()
> @@ -1696,18 +1695,14 @@ class KernelDoc:
>                      if self.state == state.PROTO:
>                          if line.endswith("\\"):
>                              prev += line.rstrip("\\")
> -                            cont = True
> -
>                              if not prev_ln:
>                                  prev_ln = ln
> -
>                              continue
>  
> -                        if cont:
> +                        if prev:
>                              ln = prev_ln
>                              line = prev + line
>                              prev = ""
> -                            cont = False
>                              prev_ln = None
>  
>                      self.config.log.debug("%d %s%s: %s",



Thanks,
Mauro




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux