linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [linux-next:master 9303/13299] arch/m68k/include/asm/raw_io.h:20:18: warning: array subscript 0 is outside array bounds of 'const volatile u8[0]' {aka 'const volatile unsigned char[]'}
Date: Thu, 19 Oct 2023 07:09:31 +0800	[thread overview]
Message-ID: <202310190741.mbPtQRpD-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2dac75696c6da3c848daa118a729827541c89d33
commit: c7db3832ff19a9a1116c1b3d435c9db165a2f2f8 [9303/13299] m68k: io: Mark mmio read addresses as const
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231019/202310190741.mbPtQRpD-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231019/202310190741.mbPtQRpD-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/202310190741.mbPtQRpD-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/m68k/include/asm/io_mm.h:25,
                    from arch/m68k/include/asm/io.h:8,
                    from include/linux/io.h:13,
                    from drivers/hwmon/pc87427.c:31:
   drivers/hwmon/pc87427.c: In function 'pc87427_readall_pwm':
>> arch/m68k/include/asm/raw_io.h:20:18: warning: array subscript 0 is outside array bounds of 'const volatile u8[0]' {aka 'const volatile unsigned char[]'} [-Warray-bounds=]
      20 |     ({ u8 __v = (*(__force const volatile u8 *) (unsigned long)(addr)); __v; })
         |                 ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/m68k/include/asm/io_mm.h:345:62: note: in expansion of macro 'in_8'
     345 | #define inb(port)       ((port) < 1024 ? isa_rom_inb(port) : in_8(port))
         |                                                              ^~~~
   drivers/hwmon/pc87427.c:244:32: note: in expansion of macro 'inb'
     244 |         data->pwm_enable[nr] = inb(iobase + PC87427_REG_PWM_ENABLE);
         |                                ^~~
   cc1: note: source object is likely at address zero


vim +20 arch/m68k/include/asm/raw_io.h

    15	
    16	/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
    17	 * two accesses to memory, which may be undesirable for some devices.
    18	 */
    19	#define in_8(addr) \
  > 20	    ({ u8 __v = (*(__force const volatile u8 *) (unsigned long)(addr)); __v; })
    21	#define in_be16(addr) \
    22	    ({ u16 __v = (*(__force const volatile u16 *) (unsigned long)(addr)); __v; })
    23	#define in_be32(addr) \
    24	    ({ u32 __v = (*(__force const volatile u32 *) (unsigned long)(addr)); __v; })
    25	#define in_le16(addr) \
    26	    ({ u16 __v = le16_to_cpu(*(__force const volatile __le16 *) (unsigned long)(addr)); __v; })
    27	#define in_le32(addr) \
    28	    ({ u32 __v = le32_to_cpu(*(__force const volatile __le32 *) (unsigned long)(addr)); __v; })
    29	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


                 reply	other threads:[~2023-10-18 23:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202310190741.mbPtQRpD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-mm@kvack.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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