On Sun, 9 Oct 2016, Michal Meloun wrote:
Log: ARM: Remove unused includes.MFC after: 1 week ... Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/allwinner/a10_gpio.c Sun Oct 9 10:25:47 2016 (r306902) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include <sys/gpio.h> #include <machine/bus.h> -#include <machine/cpu.h> -#include <machine/cpufunc.h> #include <machine/resource.h> #include <machine/intr.h> ...
It is correct to remove them, but are they really unused? machine/cpufunc.h is my invention for holding miscellaneous 1-lime asms on i386. It is apparently something completely different (much larger and uglier) on arm. On i386, it is considered as an extension of likbern so it is included in <sys/system.h>. It is included there for all arches, and it is a style bug to not depend on that. Including sys/libkern.h is another style bug. machine/cpu.h is for holding MD definitions of MI APIs like TRAPF_USERMODE() and not much else. Almost nothing needs these APIs so almost nothing should include this header. But the header has lots of namespace pollution and might provide other APIs accidentally. On arm, it isn't much larger than on i386, but has a few definitions like struct arm_boot_params that are completely unrelated to MI APIs. get_cyclecount() is misimplemented on most arches, and arm is no exception. It is an MI API, but not worth inlining unless it is 1 fast instruction. Bruce _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "[email protected]"
