Date: Mon, 10 Oct 2016 14:21:07 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Michal Meloun <mmel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: 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 Message-ID: <20161010140648.Y1935@besplex.bde.org> In-Reply-To: <201610091025.u99APl98067605@repo.freebsd.org> References: <201610091025.u99APl98067605@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161010140648.Y1935>