linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: James Hogan <james.hogan@imgtec.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
	linux-metag@vger.kernel.org
Subject: Re: [RFC PATCH -next] Fix printk_once build errors due to __read_mostly
Date: Wed, 30 Oct 2013 06:46:50 -0700	[thread overview]
Message-ID: <1383140810.12439.69.camel@joe-AO722> (raw)
In-Reply-To: <1383128301-20231-1-git-send-email-james.hogan@imgtec.com>

On Wed, 2013-10-30 at 10:18 +0000, James Hogan wrote:
> Commit 3e39c1ab04ba (printk: mark printk_once test variable
> __read_mostly) added __read_mostly to the __print_once bool in the
> printk_once() macro, but __read_mostly is defined in <linux/cache.h>
> which isn't included from <linux/printk.h>. This results in build errors
> like this:
> 
> arch/metag/mm/l2cache.c: In function 'meta_l2c_setup':
> arch/metag/mm/l2cache.c:56: error: '__read_mostly' undeclared
> 
> This is fixed by adding an include of <linux/cache.h> from
> <linux/printk.h> since I don't think printk_once() users should need to
> include <linux/cache.h> for it to work.
> 
> 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.

Thanks James.

Oh well.  Pity about the recursive #include.
It seems most every actual use of __read_mostly gets
that cache.h include indirectly.

Perhaps it's better just to remove the __read_mostly patch
as the __read_mostly value is pretty low.

Andrew, could you please remove my __read_mostly patch?

I preferred that printk.h not be a file that
could be independently used via #include.

https://lkml.org/lkml/2011/5/25/331
https://lkml.org/lkml/2011/5/25/333

and that only kernel.h should be used.

Maybe that's still a better approach.

  reply	other threads:[~2013-10-30 13:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 10:18 [RFC PATCH -next] Fix printk_once build errors due to __read_mostly James Hogan
2013-10-30 13:46 ` Joe Perches [this message]
2013-10-30 17:02 ` Joe Perches
2013-10-30 20:48 ` Andrew Morton
2013-10-30 22:58   ` Joe Perches
2013-10-30 23:01   ` [PATCH V2] printk/cache: Mark printk_once test variable __read_mostly Joe Perches
2013-10-31 13:35     ` James Hogan
2013-10-30 23:18   ` [RFC PATCH -next] Fix printk_once build errors due to __read_mostly Stephen Rothwell
2013-10-31 18:29   ` [PATCH V3] printk/cache: Mark printk_once test variable __read_mostly Joe Perches
2013-11-13  0:23     ` Tony Luck
2013-11-13  0:29       ` Joe Perches
2013-11-13 19:31         ` Tony Luck
     [not found]           ` <CA+8MBbJKN174=ybMNE7Z+oT7KjNBzgdy9cvhb_kACvXAbTo9XA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-14  1:16             ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383140810.12439.69.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-metag@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).