[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260123132054.2d46fb97@foz.lan>
Date: Fri, 23 Jan 2026 13:20:54 +0100
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Randy Dunlap <rdunlap@...radead.org>, Stephen Rothwell
<sfr@...b.auug.org.au>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar
<mingo@...nel.org>, "H. Peter Anvin" <hpa@...or.com>, Marco Elver
<elver@...gle.com>, Linux Kernel Mailing List
<linux-kernel@...r.kernel.org>, Linux Next Mailing List
<linux-next@...r.kernel.org>, Mauro Carvalho Chehab <mchehab@...nel.org>,
Linux Documentation <linux-doc@...r.kernel.org>, Jonathan Corbet
<corbet@....net>
Subject: Re: linux-next: [DOCS] build warning after merge of the tip tree
Hi Peter,
On Fri, 23 Jan 2026 12:28:56 +0100
Peter Zijlstra <peterz@...radead.org> wrote:
> On Fri, Jan 23, 2026 at 08:11:26AM +0100, Mauro Carvalho Chehab wrote:
>
> > > tools/lib/python/kdoc/kdoc_parser.py | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > --- a/tools/lib/python/kdoc/kdoc_parser.py
> > > +++ b/tools/lib/python/kdoc/kdoc_parser.py
> > > @@ -186,6 +186,7 @@ function_xforms = [
> > > (KernRe(r"__sched +"), ""),
> > > (KernRe(r"_noprof"), ""),
> > > (KernRe(r"__always_unused *"), ""),
> > > + (KernRe(r"__cond_acquires\s*\(.*\)"), ""),
> >
> > Regex here is too broad, as it is greedy: it may drop more
> > than expected. Perhaps:
> >
> > (KernRe(r"__cond_acquires\s*\([^\)]*\)"), ""),
>
> I have of course no idea what so ever how any of this works, but it
> occurs to me that __acquires() and __releases() are not in that same
> list, what happens to them?
You mean in functions like those, for instance:
int device_links_read_lock(void) __acquires(&device_links_srcu)
{
return srcu_read_lock(&device_links_srcu);
}
void device_links_read_unlock(int idx) __releases(&device_links_srcu)
{
srcu_read_unlock(&device_links_srcu, idx);
}
Yeah, we need to add something for those as well.
>
> Also, there will 'soon' be an equivalent: __cond_releases():
>
> https://lkml.kernel.org/r/20260121111213.634625032@infradead.org
The table "function_xforms" is a set of regular expressions to replace
macros into something that will be a pure C function declaration.
It should be able to handle most macros (*).
Each line in the table has two arguments:
- a regex
- a replace expression
In this specific case, if we remove __cond_acquires(.*) from the
function prototype, the remaining function will be a pure C
prototype.
So, I'd say we need to have all 4 macros there:
(KernRe(r"__cond_acquires\s*\([^\)]*\)"), ""),
(KernRe(r"__cond_releases\s*\([^\)]*\)"), ""),
(KernRe(r"__acquires\s*\([^\)]*\)"), ""),
(KernRe(r"__releases\s*\([^\)]*\)"), ""),
to avoid any warnings related to such annotations.
(*) there is a variant for very complex macros - currently used
only for struct_group_*.
Thanks,
Mauro
Powered by blists - more mailing lists