Re: [RFC PATCH -next] Fix printk_once build errors due to__read_mostly

From: Joe Perches
Date: Wed Oct 30 2013 - 18:58:45 EST

On Wed, 2013-10-30 at 13:48 -0700, Andrew Morton wrote:
> On Wed, 30 Oct 2013 10:18:21 +0000 James Hogan <james.hogan@xxxxxxxxxx> wrote:
> > Note that this actually adds a recursive include, since <linux/cache.h>
> > includes <linux/kernel.h>, which includes <linux/printk.h>. The actual
> > dependencies are all in macros so it doesn't actually seem to result in
> > any build failures, but it's clearly less than ideal.
> Yitch.


There are about ~700 files in the tree that use __read_mostly.
Only about ~25 of those actually #include <linux/cache.h>

I did a script that adds the #include, but 700 files is a _lot_.

For today's next:

$ git grep -w --name-only __read_mostly | \
xargs grep -P -l "^\s*#\s*include\s+<linux/cache.h>" | wc -l

$ git grep -w --name-only __read_mostly | \
xargs grep -P -L "^\s*#\s*include\s+<linux/cache.h>" | wc -l

Untangling that crud is nasty.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at