mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Engestrom <eric.engestrom@imgtec.com>
To: <linux-kernel@vger.kernel.org>
Cc: Eric Engestrom <eric.engestrom@imgtec.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Joe Perches <joe@perches.com>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	"David S. Miller" <davem@davemloft.net>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>
Subject: [RFC] Add missing #include <linux/bug.h>
Date: Mon, 25 Apr 2016 19:10:55 +0100	[thread overview]
Message-ID: <1461607856-27790-1-git-send-email-eric.engestrom@imgtec.com> (raw)

ARRAY_SIZE uses BUILD_BUG_ON_ZERO, which is undefined is you don't
include linux/bug.h first, which just happened to me.

Is there any reason this include isn't here? A quick grep found 595
other files using a define from bug.h without ever including it.

If this is a simple mistake and was forgotten, I can send an actual
patchset to fix this, but it feels like it was left out on purpose.

Cheers,
  Eric Engestrom

PS: If this is a cleanup that needs to be done, I might to it for other
headers as well.

---
 include/linux/compiler-gcc.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index eeae401..01e6869 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -2,6 +2,8 @@
 #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
 #endif
 
+#include <linux/bug.h>
+
 /*
  * Common definitions for all gcc versions go here.
  */
-- 
2.8.1

             reply	other threads:[~2016-04-25 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 18:10 Eric Engestrom [this message]
2016-04-25 18:36 ` Andrew Morton

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=1461607856-27790-1-git-send-email-eric.engestrom@imgtec.com \
    --to=eric.engestrom@imgtec.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    /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

all inboxes | Powered by JetHome®