Re: First pass at janitorial kernel cleanup scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 1 Jul 2025, Dan Carpenter wrote:

> On Mon, Jun 30, 2025 at 04:43:38PM -0400, Robert P. J. Day wrote:
> > > >   - are there header files that are never included anymore?
> > >
> > > That's a good idea.
> >
> >   I have a script that tracks down exactly that sort of thing. I'm
> > just cleaning that up now. There seems to still be a fair bit of that.
> > As a representative example, there is a header file in the kernel
> > source tree:
> >
> >   ./sound/soc/amd/include/acp_2_2_enum.h
> >
> > Does anything include it? Nope:
> >
> >   $ grep -r acp_2_2_enum.h *
> >   $
> >
> > So my scripts still identify plenty of potential cleanup.
>
> Yeah...  acp_2_2_enum.h was never used.  But AMD is the company I was
> thinking about which does some of these things to work around
> complications with legal.  There is a probably a reason for the header
> file to exist.
>
> I feel like we have to tie this with a commit the removed the last user.

  Totally agree ... in fact, I added a note to my kernel cleanup wiki
page about using "git log" to track down references to stuff to see
when/why it was removed to more completely understand if something is
*truly* removable.

  As an example, I ran my "find unused headers" script against the
arch/mips directory, and got the following:

===== amon.h =====
./arch/mips/include/asm/amon.h
===== bcm1480_l2c.h =====
./arch/mips/include/asm/sibyte/bcm1480_l2c.h
arch/mips/include/asm/sibyte/bcm1480_l2c.h:    *  L2 Cache constants
and macros		File: bcm1480_l2c.h
===== bcm1480_mc.h =====
./arch/mips/include/asm/sibyte/bcm1480_mc.h
arch/mips/include/asm/sibyte/bcm1480_mc.h:    *  Memory Controller
constants		File: bcm1480_mc.h
===== sb1250_l2c.h =====
./arch/mips/include/asm/sibyte/sb1250_l2c.h
arch/mips/include/asm/sibyte/sb1250_l2c.h:    *  L2 Cache constants
and macros		File: sb1250_l2c.h
===== sb1250_ldt.h =====
./arch/mips/include/asm/sibyte/sb1250_ldt.h
arch/mips/include/asm/sibyte/sb1250_ldt.h:    *  LDT constants
File: sb1250_ldt.h
===== sb1250_mc.h =====
./arch/mips/include/asm/sibyte/sb1250_mc.h
arch/mips/include/asm/sibyte/sb1250_mc.h:    *  Memory Controller
constants		File: sb1250_mc.h
===== sb1250_syncser.h =====
./arch/mips/include/asm/sibyte/sb1250_syncser.h
arch/mips/include/asm/sibyte/sb1250_syncser.h:    *  Synchronous
Serial Constants		 File: sb1250_syncser.h
===== sead3-addr.h =====
./arch/mips/include/asm/mips-boards/sead3-addr.h


As best I can tell, those are header files that are not referenced
from anywhere in the kernel tree.

This is the next script I will add to my wiki page -- there is still a
*buttload* of cleanup ready for someone to tackle.

rday




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux