tech-kern archive

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

Re: Unused functions in kernels



On Sat, 4 Jun 2016, Joerg Sonnenberger wrote:

A lot of this are generic interfaces that may or may not be used by a
platform. Going down and conditionalizing pieces seems to be just asking
for maintainance trouble for little to no gain.

Yes, I agree -- my mail was not a call to mindlessly add #ifdef:s. But I sometimes hear people complain that NetBSD is hard to run on the old, small, architecture. So the 7% should be seen as a data point about what can easily be gained.

all callers of ip6_forward.c are within #if 0 blocks, so ip6_forward.c could
be removed from files.netinet6)

Even then, I'd argue that it is the wrong approach. We have too much
conditionals already. A better approach would be to just use
-ffunction-sections -fdata-sections and link with -Wl,--gc-sections.

But several of the functions are not used in any configuration! (such as the ip6_forward.c, or fpu_cordit2()) I think these should be removed from the source code, even if -ffunction-sections or similar is used...

   /Krister


Home | Main Index | Thread Index | Old Index