mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 1/6] include: array_size.h: make header self-contained
Date: Mon,  9 Feb 2026 10:10:26 +0100	[thread overview]
Message-ID: <20260209091513.3563412-2-a.fatoum@barebox.org> (raw)
In-Reply-To: <20260209091513.3563412-1-a.fatoum@barebox.org>

The definition of __must_be_array is a bit hairy as it's defined in
<linux/compiler-gcc.h>, which is included by <linux/compiler_types.h>,
but has an implicit dependency on <linux/build_bug.h> for BUILD_BUG_ON_ZERO
in the definition of __must_be_array, but <linux/build_bug.h> itself
already includes <linux/compiler_types.h>.

Let's put a bandaid on this for users of ARRAY_SIZE, by including
<linux/build_bug.h> explicitly for <linux/array_size.h>.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 include/linux/array_size.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/array_size.h b/include/linux/array_size.h
index 5411d730c819..d1ad53d950d4 100644
--- a/include/linux/array_size.h
+++ b/include/linux/array_size.h
@@ -2,7 +2,8 @@
 #ifndef _LINUX_ARRAY_SIZE_H
 #define _LINUX_ARRAY_SIZE_H
 
-#include <linux/compiler.h>
+#include <linux/compiler_types.h>
+#include <linux/build_bug.h>
 
 /**
  * ARRAY_SIZE - get the number of elements in array @arr
-- 
2.47.3




  reply	other threads:[~2026-02-09  9:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09  9:10 [PATCH 0/6] ppc: add QEMU ppce500 test in CI Ahmad Fatoum
2026-02-09  9:10 ` Ahmad Fatoum [this message]
2026-02-09  9:10 ` [PATCH 2/6] serial: ns16550: add "ns16550" compatible string Ahmad Fatoum
2026-02-09  9:10 ` [PATCH 3/6] lib: stackprot: omit HAVE_STACKPROTECTOR for powerpc Ahmad Fatoum
2026-02-09  9:10 ` [PATCH 4/6] gpio: mpc8xxx: allow build on MPC85xx platforms Ahmad Fatoum
2026-02-09  9:10 ` [PATCH 5/6] mach-mpc85xx: speed: add fsl_set_timebase_clock() override Ahmad Fatoum
2026-02-09  9:10 ` [PATCH 6/6] powerpc: add QEMU ppce500 board support with CI test infrastructure Ahmad Fatoum
2026-02-11  9:34 ` [PATCH 0/6] ppc: add QEMU ppce500 test in CI Sascha Hauer

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=20260209091513.3563412-2-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.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