Re: [PATCH 0/8] mm: remove unused functions
From: David Hildenbrand (Arm)
Date: Mon Oct 26 2026 - 06:39:00 EST
On 10/26/26 11:30, Shivank Garg wrote:
> This series removes 16 functions and one variable in mm that have no
> users left anywhere in the tree. The functions are all static inline
> helpers in headers, which no compiler warns about: GCC never reports
> unused static inline functions, and Clang only reports them in .c
> files, and only with W=2. The variable is heap_stack_gap in
> mm/nommu.c, unused since the start of git history. Each patch covers
> one file or subsystem, so they can be picked or dropped independently.
>
> How they were found:
>
> I wrote some Python scripts, with the help of an LLM, that scan the
> whole tree for every config and architecture at once. They look for
> static inline functions without callers, and for non-static functions
> named nowhere but in their own definition, declarations, stubs and
> EXPORT_SYMBOL(). Where a ## macro could paste together one of the
> names, they read every call of that macro to see whether one does.
> The candidates were then cross-checked with a real build: a scratch
> tree marks each one __deprecated, an x86_64 allmodconfig build is run,
> and any candidate that triggers even one deprecation warning is
> dropped. The final report labels a symbol "Sure" only when that build
> confirms it unused, and "Unsure" when the build doesn't compile it or
> the scripts can't rule out a use.
>
> Before posting, I searched lore with semcode MCP for removals that
> others had already posted, to avoid duplicates. Each patch was also
> build-tested on its own.
>
> The scripts and a generated HTML report are here [1], if anyone wants
> to play with them:
>
After the merge window please. Focus on reviewing fixes on the list.
--
Cheers,
David