svn commit: r306902 - in head/sys/arm: allwinner amlogic/aml8726 at91 broadcom/bcm2835 freescale/imx lpc mv rockchip ti ti/am335x ti/omap4 ti/twl xscale/i8134x xscale/ixp425

Bruce Evans brde at optusnet.com.au
Mon Oct 10 03:21:12 UTC 2016


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


More information about the svn-src-all mailing list