* apparently, numerous unused header files under arch/arm
@ 2009-09-30 8:12 Robert P. J. Day
2009-09-30 14:46 ` David Brown
2009-09-30 14:47 ` Bill Gatliff
0 siblings, 2 replies; 5+ messages in thread
From: Robert P. J. Day @ 2009-09-30 8:12 UTC (permalink / raw)
To: linux-arm-kernel
as part of a new tree scan with one of my scripts, i located what
*appear* to be numerous header files under arch/arm that no one seems
to be including. the first few in that list, accompanied by a full
tree scan of any use of the filename:
===== at91_adc.h =====
./arch/arm/mach-at91/include/mach/at91_adc.h
arch/arm/mach-at91/include/mach/at91_adc.h: * arch/arm/mach-at91/include/mach/at91_adc.h
===== at91_spi.h =====
./arch/arm/mach-at91/include/mach/at91_spi.h
arch/arm/mach-at91/include/mach/at91_spi.h: * arch/arm/mach-at91/include/mach/at91_spi.h
===== at91_ssc.h =====
./arch/arm/mach-at91/include/mach/at91_ssc.h
arch/arm/mach-at91/include/mach/at91_ssc.h: * arch/arm/mach-at91/include/mach/at91_ssc.h
===== aux_reg.h =====
./arch/arm/mach-l7200/include/mach/aux_reg.h
arch/arm/mach-l7200/include/mach/aux_reg.h: * arch/arm/mach-l7200/include/mach/aux_reg.h
===== bast-pmu.h =====
./arch/arm/mach-s3c2410/include/mach/bast-pmu.h
arch/arm/mach-s3c2410/include/mach/bast-pmu.h:/* arch/arm/mach-s3c2410/include/mach/bast-pmu.h
===== board-mx35pdk.h =====
./arch/arm/plat-mxc/include/mach/board-mx35pdk.h
===== board-pcm043.h =====
./arch/arm/plat-mxc/include/mach/board-pcm043.h
===== board-voiceblue.h =====
./arch/arm/plat-omap/include/mach/board-voiceblue.h
... etc etc ...
so, for example, nothing seems to include that last listed
board-voiceblue.h header, not even the source file that's the obvious
candidate: arch/arm/mach-omap1/board-voiceblue.c. and there's lots
more of those. (they're listed in alphabetical order, and i was only
up to the "b"s, but it's almost certain that i'll have some false
positives in there somewhere, perhaps because of Makefile-based
includes.)
is there any interest in my posting that arm-specific list somewhere
and people can peruse it and decide what, if anything, they want to do
with it?
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Annoying Kernel Pedantry.
Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
* apparently, numerous unused header files under arch/arm
2009-09-30 8:12 apparently, numerous unused header files under arch/arm Robert P. J. Day
@ 2009-09-30 14:46 ` David Brown
2009-09-30 18:21 ` Robert P. J. Day
2009-09-30 14:47 ` Bill Gatliff
1 sibling, 1 reply; 5+ messages in thread
From: David Brown @ 2009-09-30 14:46 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 30, 2009 at 01:12:22AM -0700, Robert P. J. Day wrote:
> is there any interest in my posting that arm-specific list somewhere
> and people can peruse it and decide what, if anything, they want to do
> with it?
Any chance the script itself could be made available? I would
find this useful as I'm working through large amounts of code to
get it to a state where it can be sent out as patches.
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* apparently, numerous unused header files under arch/arm
2009-09-30 8:12 apparently, numerous unused header files under arch/arm Robert P. J. Day
2009-09-30 14:46 ` David Brown
@ 2009-09-30 14:47 ` Bill Gatliff
2009-09-30 15:15 ` Robert P. J. Day
1 sibling, 1 reply; 5+ messages in thread
From: Bill Gatliff @ 2009-09-30 14:47 UTC (permalink / raw)
To: linux-arm-kernel
Robert P. J. Day wrote:
> as part of a new tree scan with one of my scripts, i located what
> *appear* to be numerous header files under arch/arm that no one seems
> to be including. the first few in that list, accompanied by a full
> tree scan of any use of the filename:
>
Would any of those files be of use to user applications?
b.g.
--
Bill Gatliff
bgat at billgatliff.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* apparently, numerous unused header files under arch/arm
2009-09-30 14:47 ` Bill Gatliff
@ 2009-09-30 15:15 ` Robert P. J. Day
0 siblings, 0 replies; 5+ messages in thread
From: Robert P. J. Day @ 2009-09-30 15:15 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, 30 Sep 2009, Bill Gatliff wrote:
> Robert P. J. Day wrote:
> > as part of a new tree scan with one of my scripts, i located
> > what *appear* to be numerous header files under arch/arm that no
> > one seems to be including. the first few in that list,
> > accompanied by a full tree scan of any use of the filename:
>
> Would any of those files be of use to user applications?
don't know -- the script doesn't filter based on any Kbuild files,
so it's entirely possible that there are false positives. give me a
few minutes and i'll post the list. it contains 58 files, sorted by
subdirectory so, really, it's not *overwhelmingly* long.
i can post the script as well, but give me a chance to clean it up a
bit first.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Annoying Kernel Pedantry.
Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
* apparently, numerous unused header files under arch/arm
2009-09-30 14:46 ` David Brown
@ 2009-09-30 18:21 ` Robert P. J. Day
0 siblings, 0 replies; 5+ messages in thread
From: Robert P. J. Day @ 2009-09-30 18:21 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, 30 Sep 2009, David Brown wrote:
> On Wed, Sep 30, 2009 at 01:12:22AM -0700, Robert P. J. Day wrote:
>
> > is there any interest in my posting that arm-specific list
> > somewhere and people can peruse it and decide what, if anything,
> > they want to do with it?
>
> Any chance the script itself could be made available? I would find
> this useful as I'm working through large amounts of code to get it
> to a state where it can be sent out as patches.
an embarrassingly brute force approach -- most of my scripts are
just tweaked variations of the following. run from whatever
location you want, and customize to taste:
===== start script =====
#!/bin/sh
# This script should always be run from the *top* of the kernel
# source tree.
#
# Typical usage:
#
# $ find_unused_headers.sh sound
#
# Make sure you run some version of "make clean" before running
# this script.
DIR=${1-*} # optional dir to scan, otherwise "."
# Make a list of all of the header files in the given directory
# structure, and rip off their basenames.
LONGHDRS=$(find ${DIR} -name "*.h")
HDRS=""
for h in ${LONGHDRS} ; do
HDRS="${HDRS} $(basename ${h})"
done
#
# just for fun, process them in sorted order
#
HDRS=$(for h in ${HDRS} ; do echo $h ; done | sort -u)
# echo "${HDRS}"
#
# Test that each header file is included from *somewhere*.
#
for h in ${HDRS} ; do
# echo "Testing $h ..."
egrep -rwq " *# *include.*\b${h}\b" * || {
echo "===== ${h} ====="
find . -name "${h}"
grep -rwH ${h} *
}
done
===== end script =====
that last "grep" is simply to scan the *entire* source tree, looking
for that header file name *anywhere*, and that's what might reveal
that it's being used by something somewhere else, like in a Makefile.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Annoying Kernel Pedantry.
Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-09-30 18:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-30 8:12 apparently, numerous unused header files under arch/arm Robert P. J. Day
2009-09-30 14:46 ` David Brown
2009-09-30 18:21 ` Robert P. J. Day
2009-09-30 14:47 ` Bill Gatliff
2009-09-30 15:15 ` Robert P. J. Day
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.