All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Niklas Schnelle <schnelle@linux.ibm.com>,
	Arnd Bergmann <arnd@arndb.de>, Vineet Gupta <vgupta@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH v5 3/3] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE
Date: Mon, 10 May 2021 21:03:56 +0800	[thread overview]
Message-ID: <202105102014.AoEdJzot-lkp@intel.com> (raw)
In-Reply-To: <20210510085339.1857696-4-schnelle@linux.ibm.com>

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

Hi Niklas,

I love your patch! Perhaps something to improve:

[auto build test WARNING on soc/for-next]
[also build test WARNING on asm-generic/master v5.13-rc1 next-20210510]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Niklas-Schnelle/asm-generic-io-h-Silence-Wnull-pointer-arithmetic-warning-on-PCI_IOBASE/20210510-165435
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: h8300-randconfig-r035-20210510 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/fa75946a8988026bee808b5840438a3908f0a65b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Niklas-Schnelle/asm-generic-io-h-Silence-Wnull-pointer-arithmetic-warning-on-PCI_IOBASE/20210510-165435
        git checkout fa75946a8988026bee808b5840438a3908f0a65b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=h8300 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10,
                    from drivers/media/rc/nuvoton-cir.c:25:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   include/asm-generic/page.h:89:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      89 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
     137 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
     137 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/media/rc/nuvoton-cir.c: In function 'nvt_get_rx_ir_data':
>> drivers/media/rc/nuvoton-cir.c:761:15: warning: iteration 32 invokes undefined behavior [-Waggressive-loop-optimizations]
     761 |   nvt->buf[i] = nvt_cir_reg_read(nvt, CIR_SRXFIFO);
         |   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/rc/nuvoton-cir.c:760:2: note: within this loop
     760 |  for (i = 0; i < fifocount; i++)
         |  ^~~


vim +761 drivers/media/rc/nuvoton-cir.c

fbdc781c6ba974 drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-08  747  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  748  /* copy data from hardware rx fifo into driver buffer */
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  749  static void nvt_get_rx_ir_data(struct nvt_dev *nvt)
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  750  {
6db0168821fa4e drivers/media/rc/nuvoton-cir.c Heiner Kallweit 2016-08-02  751  	u8 fifocount;
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  752  	int i;
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  753  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  754  	/* Get count of how many bytes to read from RX FIFO */
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  755  	fifocount = nvt_cir_reg_read(nvt, CIR_RXFCONT);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  756  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  757  	nvt_dbg("attempting to fetch %u bytes from hw rx fifo", fifocount);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  758  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  759  	/* Read fifocount bytes from CIR Sample RX FIFO register */
6db0168821fa4e drivers/media/rc/nuvoton-cir.c Heiner Kallweit 2016-08-02  760  	for (i = 0; i < fifocount; i++)
6db0168821fa4e drivers/media/rc/nuvoton-cir.c Heiner Kallweit 2016-08-02 @761  		nvt->buf[i] = nvt_cir_reg_read(nvt, CIR_SRXFIFO);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  762  
bacf8351f23cfd drivers/media/rc/nuvoton-cir.c Heiner Kallweit 2016-08-02  763  	nvt->pkts = fifocount;
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  764  	nvt_dbg("%s: pkts now %d", __func__, nvt->pkts);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  765  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  766  	nvt_process_rx_ir_data(nvt);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  767  }
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  768  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26536 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v5 3/3] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE
Date: Mon, 10 May 2021 21:03:56 +0800	[thread overview]
Message-ID: <202105102014.AoEdJzot-lkp@intel.com> (raw)
In-Reply-To: <20210510085339.1857696-4-schnelle@linux.ibm.com>

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

Hi Niklas,

I love your patch! Perhaps something to improve:

[auto build test WARNING on soc/for-next]
[also build test WARNING on asm-generic/master v5.13-rc1 next-20210510]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Niklas-Schnelle/asm-generic-io-h-Silence-Wnull-pointer-arithmetic-warning-on-PCI_IOBASE/20210510-165435
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: h8300-randconfig-r035-20210510 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/fa75946a8988026bee808b5840438a3908f0a65b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Niklas-Schnelle/asm-generic-io-h-Silence-Wnull-pointer-arithmetic-warning-on-PCI_IOBASE/20210510-165435
        git checkout fa75946a8988026bee808b5840438a3908f0a65b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=h8300 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10,
                    from drivers/media/rc/nuvoton-cir.c:25:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   include/asm-generic/page.h:89:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      89 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
     137 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
     137 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/media/rc/nuvoton-cir.c: In function 'nvt_get_rx_ir_data':
>> drivers/media/rc/nuvoton-cir.c:761:15: warning: iteration 32 invokes undefined behavior [-Waggressive-loop-optimizations]
     761 |   nvt->buf[i] = nvt_cir_reg_read(nvt, CIR_SRXFIFO);
         |   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/rc/nuvoton-cir.c:760:2: note: within this loop
     760 |  for (i = 0; i < fifocount; i++)
         |  ^~~


vim +761 drivers/media/rc/nuvoton-cir.c

fbdc781c6ba974 drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-08  747  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  748  /* copy data from hardware rx fifo into driver buffer */
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  749  static void nvt_get_rx_ir_data(struct nvt_dev *nvt)
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  750  {
6db0168821fa4e drivers/media/rc/nuvoton-cir.c Heiner Kallweit 2016-08-02  751  	u8 fifocount;
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  752  	int i;
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  753  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  754  	/* Get count of how many bytes to read from RX FIFO */
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  755  	fifocount = nvt_cir_reg_read(nvt, CIR_RXFCONT);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  756  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  757  	nvt_dbg("attempting to fetch %u bytes from hw rx fifo", fifocount);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  758  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  759  	/* Read fifocount bytes from CIR Sample RX FIFO register */
6db0168821fa4e drivers/media/rc/nuvoton-cir.c Heiner Kallweit 2016-08-02  760  	for (i = 0; i < fifocount; i++)
6db0168821fa4e drivers/media/rc/nuvoton-cir.c Heiner Kallweit 2016-08-02 @761  		nvt->buf[i] = nvt_cir_reg_read(nvt, CIR_SRXFIFO);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  762  
bacf8351f23cfd drivers/media/rc/nuvoton-cir.c Heiner Kallweit 2016-08-02  763  	nvt->pkts = fifocount;
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  764  	nvt_dbg("%s: pkts now %d", __func__, nvt->pkts);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  765  
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  766  	nvt_process_rx_ir_data(nvt);
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  767  }
6d2f5c27880c2c drivers/media/IR/nuvoton-cir.c Jarod Wilson    2010-10-07  768  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 26536 bytes --]

  reply	other threads:[~2021-05-10 13:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10  8:53 [PATCH v5 0/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE Niklas Schnelle
2021-05-10  8:53 ` Niklas Schnelle
2021-05-10  8:53 ` [PATCH v5 1/3] sparc: explicitly set PCI_IOBASE to 0 Niklas Schnelle
2021-05-10  8:53   ` Niklas Schnelle
2021-05-10  8:53 ` [PATCH v5 2/3] risc-v: Use generic io.h helpers for nommu Niklas Schnelle
2021-05-10  8:53   ` Niklas Schnelle
2021-05-10  8:53 ` [PATCH v5 3/3] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE Niklas Schnelle
2021-05-10  8:53   ` Niklas Schnelle
2021-05-10 13:03   ` kernel test robot [this message]
2021-05-10 13:03     ` kernel test robot
2021-05-10 13:47     ` Arnd Bergmann
2021-05-10 13:47       ` Arnd Bergmann
2021-05-10 13:29   ` kernel test robot
2021-05-10 13:29     ` kernel test robot
2021-05-10 13:43     ` Arnd Bergmann
2021-05-10 13:43       ` Arnd Bergmann
2021-05-10 14:06       ` Niklas Schnelle
2021-05-10 14:06         ` Niklas Schnelle

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=202105102014.AoEdJzot-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=davem@davemloft.net \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=schnelle@linux.ibm.com \
    --cc=vgupta@synopsys.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.