linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: linux-kernel@vger.kernel.org, oe-kbuild-all@lists.linux.dev,
	 Kees Cook <kees@kernel.org>,
	Christopher Bazley <chris.bazley.wg14@gmail.com>,
	 Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Marco Elver <elver@google.com>, Michal Hocko <mhocko@suse.com>,
	 Al Viro <viro@zeniv.linux.org.uk>,
	Alexander Potapenko <glider@google.com>,
	 Dmitry Vyukov <dvyukov@google.com>, Jann Horn <jannh@google.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH v2 1/4] array_size.h: Add ARRAY_END()
Date: Sun, 9 Nov 2025 13:30:42 +0100	[thread overview]
Message-ID: <hianmnv3t7xz4mf5oaicei4q7vqudrnkhmexzkoxags3gvyj2n@qvebtox3uvyn> (raw)
In-Reply-To: <202511091804.XUQA4dOK-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2644 bytes --]

Hi,

On Sun, Nov 09, 2025 at 06:43:46PM +0800, kernel test robot wrote:
> Hi Alejandro,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on 6146a0f1dfae5d37442a9ddcba012add260bceb0]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Alejandro-Colomar/array_size-h-Add-ARRAY_END/20251109-062234
> base:   6146a0f1dfae5d37442a9ddcba012add260bceb0
> patch link:    https://lore.kernel.org/r/35255c1ceb54518779a45351dcd79a3c1910818a.1762637046.git.alx%40kernel.org
> patch subject: [PATCH v2 1/4] array_size.h: Add ARRAY_END()
> config: alpha-defconfig (https://download.01.org/0day-ci/archive/20251109/202511091804.XUQA4dOK-lkp@intel.com/config)
> compiler: alpha-linux-gcc (GCC) 15.1.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251109/202511091804.XUQA4dOK-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202511091804.XUQA4dOK-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> drivers/block/floppy.c:4805:9: warning: 'ARRAY_END' redefined
>     4805 | #define ARRAY_END(X) (&((X)[ARRAY_SIZE(X)]))
>          |         ^~~~~~~~~

Hmmm, nice!  There's already an ARRAY_END() there.  I'll remove that
definition.

BTW, this reminds me that I forgot to parenthesize 'a' in my
implementation.  Do you have any preference on the implementation?
I could use either of

	(&((a)[ARRAY_SIZE(a)]))

	((a) + ARRAY_SIZE(a))


Have a lovely day!
Alex

>    In file included from include/linux/string.h:6,
>                     from include/linux/bitmap.h:13,
>                     from include/linux/nodemask.h:91,
>                     from include/linux/numa.h:6,
>                     from include/linux/async.h:13,
>                     from drivers/block/floppy.c:166:
>    include/linux/array_size.h:17:9: note: this is the location of the previous definition
>       17 | #define ARRAY_END(a)  (a + ARRAY_SIZE(a))
>          |         ^~~~~~~~~
> 
> 
> vim +/ARRAY_END +4805 drivers/block/floppy.c
> 
> 5a74db06cc8d36 Philippe De Muyter 2009-02-18  4804  
> 5a74db06cc8d36 Philippe De Muyter 2009-02-18 @4805  #define ARRAY_END(X) (&((X)[ARRAY_SIZE(X)]))
> 5a74db06cc8d36 Philippe De Muyter 2009-02-18  4806  
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-11-09 12:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35255c1ceb54518779a45351dcd79a3c1910818a.1762637046.git.alx@kernel.org>
2025-11-09 10:43 ` kernel test robot
2025-11-09 12:30   ` Alejandro Colomar [this message]
2025-11-09 13:14 ` kernel test robot

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=hianmnv3t7xz4mf5oaicei4q7vqudrnkhmexzkoxags3gvyj2n@qvebtox3uvyn \
    --to=alx@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=chris.bazley.wg14@gmail.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=jannh@google.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lkp@intel.com \
    --cc=mhocko@suse.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    /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