Re: [RFC - PATCH 0/7] consolidation of BUG support code.

From: Stephen Rothwell
Date: Fri Jan 27 2012 - 00:53:23 EST


Hi Paul,

On Thu, 26 Jan 2012 21:44:25 -0500 Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx> wrote:
>
> The changes shown here are to unify linux's BUG support under
> the one <linux/bug.h> file. Due to historical reasons, we have
> some BUG code in bug.h and some in kernel.h -- i.e. the support for
> BUILD_BUG in linux/kernel.h predates the addition of linux/bug.h,
> but old code in kernel.h wasn't moved to bug.h at that time. As
> a band-aid, kernel.h was including <asm/bug.h> to pseudo link them.
> With the above in mind, the goals of this changeset are:
>
> 1) find and fix any include/*.h files that were relying on the
> implicit presence of BUG code.
> 2) find and fix any C files that were consuming kernel.h and
> hence relying on implicitly getting some/all BUG code.
> 3) Move the BUG related code living in kernel.h to <linux/bug.h>
> 4) remove the asm/bug.h from kernel.h to finally break the chain.
>
> During development, the order was more like 3-4, build-test, 1-2.
> But to ensure that git history for bisect doesn't get needless
> build failures introduced, the commits have been reorderd to fix
> the problem areas in advance.

I have expressed reservations with these tree wide include file cleanups
in the past (there was going pain for me and others during the module.h
split up for example). So, have you considered the following alternate
method of achieving most (if not all) of the gains:

First a patch that moves the BUG related stuff from kernel.h to
linux/bug.h and replacing the include of asm/bug.h with linux/bug.h in
kernel.h. This should essentially be a noop (bar some strange
interesting bugs).

The trick is to convince Linus that this patch is OK for the current RC series ...

Then you can (at your leisure) fix all the files that need linux/bug.h
included - farming them out as required. And we could add a check in
checkpatch.pl.

Then (either after 3.4-rc1 or in the 3.5 merge window) we can remove the
include of linux/bug.h from linux/kernel.h and fix any left over build
problems.

I have not thought about this too hard, so there may be large holes in
this plan.

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

Attachment: pgp00000.pgp
Description: PGP signature