Subject: Re: linux-next: [DOCS] build warning after merge of the tip tree

From: Mauro Carvalho Chehab <[email-masked]>
Date: Fri, 23 Jan 2026 13:20:54 +0100

Hi Peter,

On Fri, 23 Jan 2026 12:28:56 +0100
Peter Zijlstra <[email-masked]> 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/[email-masked]

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