]> git.hungrycats.org Git - linux/commit
slab: fix kernel-docs for mm-api
authorMarco Elver <elver@google.com>
Mon, 11 May 2026 20:00:50 +0000 (22:00 +0200)
committerVlastimil Babka (SUSE) <vbabka@kernel.org>
Thu, 14 May 2026 08:49:41 +0000 (10:49 +0200)
commite0f54249a491c62ef8196b9f13bd7d95dba47c6f
tree32007c069dd23395a2053b907211ac9b938df8c9
parent0fc1bd38a19c108395d8338fb034f90c2d3fbe55
slab: fix kernel-docs for mm-api

The mm-api kernel-docs have been disconnected from their symbols. While
the scripts were previously taught to handle the _noprof suffix added by
allocation tagging (in 51a7bf0238c2 "scripts/kernel-doc: drop "_noprof"
on function prototypes"), this does not handle cases where the internal
implementation function has an additional leading underscore. The added
optional parameters (via DECL_KMALLOC_PARAMS) further complicate parsing
the internal signatures.

When the kernel-doc block remains above the internal implementation
function but uses the public API name, the documentation generator fails
to associate the documented symbol.

Simply moving the docs to the macros in slab.h fixes the association but
causes loss of types in the generated documentation (rendering as e.g.
untyped 'kmalloc(size, flags)' macro).

Fix this by:

1. Moving the kernel-doc comment blocks from slub.c to slab.h, placing
   them directly above the user-facing macros.

2. Providing explicit, typed C prototypes for the documented APIs inside
   '#if 0 /* kernel-doc */' blocks.

3. Converting the variadic macros for the documented APIs to use
   explicit arguments to match the documentation.

No functional change intended.

Signed-off-by: Marco Elver <elver@google.com>
Link: https://patch.msgid.link/20260511200136.3201646-3-elver@google.com
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
include/linux/slab.h
mm/slub.c