Subject: Re: Unused functions
To: Krister Walfridsson <cato@df.lth.se>
From: Frank van der Linden <fvdl@wasabisystems.com>
List: tech-kern
Date: 10/11/2002 22:33:44
On Fri, Oct 11, 2002 at 10:23:50PM +0200, Krister Walfridsson wrote:
> I have amused myself by hunting for unused functions in the kernel. While
> the biggest offenders have been removed, there are still a lot of unused
> stuff in a standard kernel.

Some of these functions are in cardbus frontends for drivers (i.e.
*_detach and *_deactivate), so they can be made conditional on
that if you want them to disappear.

> bus_machdep.o T  _i386_memio_map
> bus_machdep.o T  _i386_memio_unmap

..used by apm and acpi, see above.

> ffs_vnops.o D  doclusterread
> ffs_vnops.o D  doclusterwrite

These can be removed, we don't use vfs_cluster anymore.

> gdt.o T  gdt_alloc_cpu

Hm? I don't see that one anywhere.

> if_bge.o D  bge_swapbits
> machdep.o C  cpu_info_store
> machdep.o C  cpu_serial
> machdep.o T  i386_init_pcb_tss_ldt
> machdep.o T  idt_vec_alloc
> machdep.o T  idt_vec_free
> machdep.o T  idt_vec_set

Some of these should be ifdef MULTIPROCESSOR

> mtrr_i686.o D  i686_mtrr_funcs
> mtrr_i686.o T  i686_mtrr_init_first
> mtrr_k6.o D  k6_mtrr_funcs
> mtrr_k6.o T  k6_mtrr_init_first

..should depend on the MTRR option

It looks like quite a bit of this stuff is dependent on options
but isn't properly ifdefed.

- Frank
-- 
Frank van der Linden                                    fvdl@wasabisystems.com
==============================================================================
Quality NetBSD Development, Support & Service.   http://www.wasabisystems.com/