All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jonathan Corbet <corbet@lwn.net>,
	Aditya Srivastava <yashsri421@gmail.com>
Cc: lukas.bulwahn@gmail.com, willy@infradead.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC v3] scripts: kernel-doc: reduce repeated regex expressions into variables
Date: Thu, 29 Apr 2021 19:03:09 -0700	[thread overview]
Message-ID: <8dc8272b78e2340a4244ded29d342ff0f0f519eb.camel@perches.com> (raw)
In-Reply-To: <8735v8d5ja.fsf@meer.lwn.net>

On Thu, 2021-04-29 at 17:39 -0600, Jonathan Corbet wrote:
> Aditya Srivastava <yashsri421@gmail.com> writes:
> 
> > There are some regex expressions in the kernel-doc script, which are used
> > repeatedly in the script.
> > 
> > Reduce such expressions into variables, which can be used everywhere.
> > 
> > A quick manual check found that no errors and warnings were added/removed
> > in this process.
> > 
> > Suggested-by: Jonathan Corbet <corbet@lwn.net>
> > Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
> > ---
> > Changes in v3:
> > - Remove variables for separate qualifiers in "sub dump_struct"
> > - Make a common variable for all the qualifiers
> > - Make $attribute global variable to use it at "sub check_sections" as well
> > 
> > Changes in v2:
> > - Rename $pointer_function to $function_pointer
> > - Combine elsif-block expressions at "sub dump_function" into lesser regex expressions
> > - Combine $prototype_end1,$prototype_end2 expressions into a common $prototype_end
> > 
> >  scripts/kernel-doc | 71 ++++++++++++++++++++++------------------------
> >  1 file changed, 34 insertions(+), 37 deletions(-)
> 
> So this looks good but ... it adds a warning to the build:
> 
> /stuff/k/git/kernel/Documentation/driver-api/media/v4l2-controls:823: ./include/media/v4l2-ctrls.h:964: WARNING: Invalid C declaration: Expected identifier in nested name. [error at 6]
>   const * v4l2_ctrl_get_menu (u32 id)
>   ------^
> 
> So it looks like something isn't being parsed quite identically?

Perhaps a few of the regexes from checkpatch could be used or
maybe a linux specific perl module produced.



WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Jonathan Corbet <corbet@lwn.net>,
	Aditya Srivastava <yashsri421@gmail.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org, willy@infradead.org,
	linux-doc@vger.kernel.org
Subject: Re: [RFC v3] scripts: kernel-doc: reduce repeated regex expressions into variables
Date: Thu, 29 Apr 2021 19:03:09 -0700	[thread overview]
Message-ID: <8dc8272b78e2340a4244ded29d342ff0f0f519eb.camel@perches.com> (raw)
In-Reply-To: <8735v8d5ja.fsf@meer.lwn.net>

On Thu, 2021-04-29 at 17:39 -0600, Jonathan Corbet wrote:
> Aditya Srivastava <yashsri421@gmail.com> writes:
> 
> > There are some regex expressions in the kernel-doc script, which are used
> > repeatedly in the script.
> > 
> > Reduce such expressions into variables, which can be used everywhere.
> > 
> > A quick manual check found that no errors and warnings were added/removed
> > in this process.
> > 
> > Suggested-by: Jonathan Corbet <corbet@lwn.net>
> > Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
> > ---
> > Changes in v3:
> > - Remove variables for separate qualifiers in "sub dump_struct"
> > - Make a common variable for all the qualifiers
> > - Make $attribute global variable to use it at "sub check_sections" as well
> > 
> > Changes in v2:
> > - Rename $pointer_function to $function_pointer
> > - Combine elsif-block expressions at "sub dump_function" into lesser regex expressions
> > - Combine $prototype_end1,$prototype_end2 expressions into a common $prototype_end
> > 
> >  scripts/kernel-doc | 71 ++++++++++++++++++++++------------------------
> >  1 file changed, 34 insertions(+), 37 deletions(-)
> 
> So this looks good but ... it adds a warning to the build:
> 
> /stuff/k/git/kernel/Documentation/driver-api/media/v4l2-controls:823: ./include/media/v4l2-ctrls.h:964: WARNING: Invalid C declaration: Expected identifier in nested name. [error at 6]
>   const * v4l2_ctrl_get_menu (u32 id)
>   ------^
> 
> So it looks like something isn't being parsed quite identically?

Perhaps a few of the regexes from checkpatch could be used or
maybe a linux specific perl module produced.


_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2021-04-30  2:03 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 19:18 [RFC] scripts: kernel-doc: reduce repeated regex expressions into variables Aditya Srivastava
2021-04-22 19:18 ` Aditya Srivastava
2021-04-22 19:33 ` Lukas Bulwahn
2021-04-23 12:20   ` Aditya Srivastava
2021-04-23 12:20     ` Aditya Srivastava
2021-04-23 13:21 ` Matthew Wilcox
2021-04-23 13:21   ` Matthew Wilcox
2021-04-24 11:57   ` Aditya Srivastava
2021-04-24 11:57     ` Aditya Srivastava
2021-04-24 12:47     ` [RFC v2] " Aditya Srivastava
2021-04-24 12:47       ` Aditya Srivastava
2021-04-27 15:55       ` Jonathan Corbet
2021-04-27 15:55         ` Jonathan Corbet
2021-04-27 16:56         ` Matthew Wilcox
2021-04-27 16:56           ` Matthew Wilcox
2021-04-29  6:37           ` [RFC v3] " Aditya Srivastava
2021-04-29  6:37             ` Aditya Srivastava
2021-04-29 23:39             ` Jonathan Corbet
2021-04-29 23:39               ` Jonathan Corbet
2021-04-30  2:03               ` Joe Perches [this message]
2021-04-30  2:03                 ` Joe Perches
2021-05-01  9:30               ` Aditya Srivastava
2021-05-01  9:30                 ` Aditya Srivastava
2021-05-01 15:03                 ` Jonathan Corbet
2021-05-01 15:03                   ` Jonathan Corbet
2021-05-14 14:42                   ` [RFC v4] " Aditya Srivastava
2021-05-14 14:42                     ` Aditya Srivastava
2021-05-14 15:10                     ` Aditya Srivastava
2021-05-14 15:10                       ` Aditya Srivastava
2021-05-17 17:49                     ` Jonathan Corbet
2021-05-17 17:49                       ` Jonathan Corbet
2021-05-01 15:43             ` [RFC v3] " Matthew Wilcox
2021-05-01 15:43               ` Matthew Wilcox
2021-05-14 16:17               ` Aditya Srivastava
2021-05-14 16:17                 ` Aditya Srivastava
2021-04-26 17:31     ` [RFC] " Matthew Wilcox
2021-04-26 17:31       ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8dc8272b78e2340a4244ded29d342ff0f0f519eb.camel@perches.com \
    --to=joe@perches.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=willy@infradead.org \
    --cc=yashsri421@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.