mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "George Spelvin" <linux@horizon.com>
Cc: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] VERIFY_OCTAL_PERMISSIONS needs <linux/bug.h>
Date: Fri, 5 Dec 2014 16:15:48 -0800	[thread overview]
Message-ID: <20141205161548.dfa3bc0648b2109ebed9b1ae@linux-foundation.org> (raw)
In-Reply-To: <20141206000759.14606.qmail@ns.horizon.com>

On 5 Dec 2014 19:07:59 -0500 "George Spelvin" <linux@horizon.com> wrote:

> It is possible to include <linux/kernel.h> and try to use
> VERIFY_OCTAL_PERMISSIONS, then puke because BUILD_BUG_ON_ZERO
> isn't defined.
> 
> I hit this via:
> 
> #include <linux/moduleparam.h>
> module_param(verbose, bool, 0);
> 
> IMHO, except in documented special cases, header files should
> #include their own macros' dependencies.
> 
> Signed-off-by: George Spelvin <linux@horizon.com>
> ---
>  include/linux/kernel.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> I'm not quite sure who to send this via.  Rusty, you touched
> VERIFY_OCTAL_PERMISSIONS last.  Should I send this via you, or collect
> acks and include it in the patch series I'm working on that wants this?
> 
> The workaround is easy enough, but I'd rather fix it than let cruft
> like this accumulate.
> 
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 3d770f55..afb81c1a 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -12,6 +12,7 @@
>  #include <linux/typecheck.h>
>  #include <linux/printk.h>
>  #include <linux/dynamic_debug.h>
> +#include <linux/bug.h>
>  #include <asm/byteorder.h>
>  #include <uapi/linux/kernel.h>

Absolutely everything includes kernel.h so this might have measurable
build-time impact.

VERIFY_OCTAL_PERMISSIONS() sticks out like a sore thumb in kernel.h. 
How about we move it into sysfs.h?

  parent reply	other threads:[~2014-12-06  0:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-06  0:07 George Spelvin
2014-12-06  0:12 ` Randy Dunlap
2014-12-06  0:15 ` Andrew Morton [this message]
2014-12-06  1:18   ` [PATCH] [PATCH] VERIFY_OCTAL_PERMISSIONS: Move to <linux/sysfs.h> where it belongs George Spelvin
2014-12-06  1:28     ` Andrew Morton
2014-12-06  2:49       ` George Spelvin
2014-12-06  2:53         ` Joe Perches
2014-12-06  2:57           ` Jeff Kirsher
2014-12-06  2:58         ` Andrew Morton
2014-12-06  3:23           ` [PATCH v2] " George Spelvin
2014-12-15  3:56             ` Rusty Russell
2014-12-15 23:09               ` Stephen Rothwell
2014-12-16  0:14                 ` George Spelvin
2014-12-16  0:31                   ` Stephen Rothwell

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=20141205161548.dfa3bc0648b2109ebed9b1ae@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=rusty@rustcorp.com.au \
    /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

Powered by JetHome