From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B152BC6FD1C for ; Wed, 22 Mar 2023 16:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbjCVQqD (ORCPT ); Wed, 22 Mar 2023 12:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbjCVQp4 (ORCPT ); Wed, 22 Mar 2023 12:45:56 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1B2E6A5C for ; Wed, 22 Mar 2023 09:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679503549; x=1711039549; h=date:from:to:cc:subject:message-id:mime-version; bh=HLEX+TICJUHD+xoUywFhjd9IZevwvDbZuDni1AXm058=; b=OwRMGDJtODvMZpAjHYxzwdvmAAHko+RSTsGyCH3+XopVRfcAFZgFmE12 n7F5e0JeP75Cyd50yLSgBYEH40Uhd82sEx+YbXHP97e19cVSWdd+stEr/ Hk74UefFyn4Sh1bI3Qp1QXNrDPmOxdzjtXBckGDU+o9J57JckNHdp9Anx 0JZJ0z2PMPlmB0lx9BvzUI99wk4qQHLH/ZHH9pJhghWeTkZI8+UqrnSPP NBHmgn7r/fJkZaw41MQJNKxhZBcRgLyd0VypY0kn0P7wMA7B8qfrwohih GO1kuNV8CPlgDyNF4xcixzKObVkC+Z4Tzk7GTSkNp8wuvYFwfIo9hz6AP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="318917423" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="318917423" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 09:45:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="751117882" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="751117882" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by fmsmga004.fm.intel.com with ESMTP; 22 Mar 2023 09:45:47 -0700 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1pf1as-000DVM-0k; Wed, 22 Mar 2023 16:45:46 +0000 Date: Thu, 23 Mar 2023 00:45:01 +0800 From: kernel test robot To: Haijun Liu Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Chandrashekar Devegowda , Ricardo Martinez , Loic Poulain , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Sergey Ryazanov Subject: include/asm-generic/io.h:464:31: error: performing pointer arithmetic on a null pointer has undefined behavior Message-ID: <202303230040.6r3jj0VE-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Haijun, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: a1effab7a3a35a837dd9d2b974a1bc4939df1ad5 commit: 13e920d93e37fcaef4a9309515798a3cae9dcf19 net: wwan: t7xx: Add core components date: 11 months ago config: s390-randconfig-r001-20230322 (https://download.01.org/0day-ci/archive/20230323/202303230040.6r3jj0VE-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7) 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 # install s390 cross compiling tool for clang build # apt-get install binutils-s390x-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=13e920d93e37fcaef4a9309515798a3cae9dcf19 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 13e920d93e37fcaef4a9309515798a3cae9dcf19 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202303230040.6r3jj0VE-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from drivers/net/wwan/t7xx/t7xx_pci.c:22: In file included from include/linux/dma-mapping.h:10: In file included from include/linux/scatterlist.h:9: In file included from arch/s390/include/asm/io.h:75: >> include/asm-generic/io.h:464:31: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:477:61: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x)) ^ include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16' #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x)) ^ In file included from drivers/net/wwan/t7xx/t7xx_pci.c:22: In file included from include/linux/dma-mapping.h:10: In file included from include/linux/scatterlist.h:9: In file included from arch/s390/include/asm/io.h:75: include/asm-generic/io.h:490:61: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x)) ^ include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32' #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x)) ^ In file included from drivers/net/wwan/t7xx/t7xx_pci.c:22: In file included from include/linux/dma-mapping.h:10: In file included from include/linux/scatterlist.h:9: In file included from arch/s390/include/asm/io.h:75: include/asm-generic/io.h:501:33: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:511:59: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:521:59: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:609:20: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] readsb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:617:20: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] readsw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:625:20: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] readsl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:634:21: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] writesb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:643:21: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] writesw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:652:21: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] writesl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ 12 errors generated. vim +464 include/asm-generic/io.h 3f7e212df82ca0 Arnd Bergmann 2009-05-13 450 9216efafc52ff9 Thierry Reding 2014-10-01 451 /* 9216efafc52ff9 Thierry Reding 2014-10-01 452 * {in,out}{b,w,l}() access little endian I/O. {in,out}{b,w,l}_p() can be 9216efafc52ff9 Thierry Reding 2014-10-01 453 * implemented on hardware that needs an additional delay for I/O accesses to 9216efafc52ff9 Thierry Reding 2014-10-01 454 * take effect. 9216efafc52ff9 Thierry Reding 2014-10-01 455 */ 9216efafc52ff9 Thierry Reding 2014-10-01 456 f009c89df79abe John Garry 2020-03-28 457 #if !defined(inb) && !defined(_inb) f009c89df79abe John Garry 2020-03-28 458 #define _inb _inb 214ba3584b2e2c Stafford Horne 2020-07-26 459 static inline u8 _inb(unsigned long addr) 9216efafc52ff9 Thierry Reding 2014-10-01 460 { 87fe2d543f8173 Sinan Kaya 2018-04-05 461 u8 val; 87fe2d543f8173 Sinan Kaya 2018-04-05 462 87fe2d543f8173 Sinan Kaya 2018-04-05 463 __io_pbr(); 87fe2d543f8173 Sinan Kaya 2018-04-05 @464 val = __raw_readb(PCI_IOBASE + addr); abbbbc83a210e9 Will Deacon 2019-02-22 465 __io_par(val); 87fe2d543f8173 Sinan Kaya 2018-04-05 466 return val; 9216efafc52ff9 Thierry Reding 2014-10-01 467 } 9216efafc52ff9 Thierry Reding 2014-10-01 468 #endif 9216efafc52ff9 Thierry Reding 2014-10-01 469 :::::: The code at line 464 was first introduced by commit :::::: 87fe2d543f817300e13f0ea683f38c122737856e io: change inX() to have their own IO barrier overrides :::::: TO: Sinan Kaya :::::: CC: Arnd Bergmann -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests