mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH 5/7] docs: kdoc: tighten up the array-of-pointers case
Date: Wed, 13 Aug 2025 09:16:56 -0600	[thread overview]
Message-ID: <87sehvb6af.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20250813005334.31db20b0@foz.lan>

Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:

> On Tue, 12 Aug 2025 13:57:46 -0600
> Jonathan Corbet <corbet@lwn.net> wrote:
>>              elif KernRe(r'\(.+\)\s*\[').search(arg):
>> -                # Array-of-pointers
>> -
>> -                arg = arg.replace('#', ',')
>
> Hmm... if I'm not mistaken, there is(was?) a previous code that replaced
> commas by "#". Such statement is needed to catch some corner case.
>
> This like here is(was?) needed to restore the original arg string.

That (hackish :) replacement is still there ... but there will be no
commas in anything matched by the regex here, so the restoration is not
needed.  I can add that to the changelog for curious readers in the
future. 

>> -                r = KernRe(r'[^\(]+\(\s*\*\s*([\w\[\].]*?)\s*(\s*\[\s*[\w]+\s*\]\s*)*\)')
>> +                r = KernRe(r'[^\(]+\(\s*\*\s*' r'([\w.]*?)' r'\s*(\[\s*\w+\s*\]\s*)*\)')
>
> As mentioned on patch 6/7, IMHO doing concats like that at the same line
> IMO makes it harder to understand. This works best:
>
>                 r = KernRe(r'[^\(]+\(\s*\*\s*'
> 			   r'([\w.]*?)'
> 			   r'\s*(\[\s*\w+\s*\]\s*)*\)')

I'll do that.

Thanks,

jon

  reply	other threads:[~2025-08-13 15:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 19:57 [PATCH 0/7] docs: kdoc: tidy up create_parameter_list() somewhat Jonathan Corbet
2025-08-12 19:57 ` [PATCH 1/7] docs: kdoc: remove dead code Jonathan Corbet
2025-08-12 22:43   ` Mauro Carvalho Chehab
2025-08-12 19:57 ` [PATCH 2/7] docs: kdoc: tidy up space removal in create_parameter_list() Jonathan Corbet
2025-08-12 22:44   ` Mauro Carvalho Chehab
2025-08-12 19:57 ` [PATCH 3/7] docs: kdoc: clean up the create_parameter_list() "first arg" logic Jonathan Corbet
2025-08-12 23:17   ` Mauro Carvalho Chehab
2025-08-13 15:46     ` Jonathan Corbet
2025-08-12 19:57 ` [PATCH 4/7] docs: kdoc: add a couple more comments in create_parameter_list() Jonathan Corbet
2025-08-12 22:47   ` Mauro Carvalho Chehab
2025-08-12 19:57 ` [PATCH 5/7] docs: kdoc: tighten up the array-of-pointers case Jonathan Corbet
2025-08-12 22:53   ` Mauro Carvalho Chehab
2025-08-13 15:16     ` Jonathan Corbet [this message]
2025-08-12 19:57 ` [PATCH 6/7] docs: kdoc: tighten up the pointer-to-function case Jonathan Corbet
2025-08-12 22:39   ` Mauro Carvalho Chehab
2025-08-12 23:22     ` Jonathan Corbet
2025-08-13  9:02       ` Mauro Carvalho Chehab
2025-08-12 19:57 ` [PATCH 7/7] docs: kdoc: remove redundant comment stripping Jonathan Corbet
2025-08-12 23:19   ` Mauro Carvalho Chehab

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=87sehvb6af.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=akiyks@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®