Hi John,
I love your patch! Perhaps something to improve:
[auto build test WARNING on arm-soc/for-next]
[also build test WARNING on linux/master linus/master v5.6-rc6 next-20200318]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see
https://stackoverflow.com/a/37406982]
url:
https://github.com/0day-ci/linux/commits/John-Garry/io-h-logic_pio-Allow-...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git for-next
config: x86_64-defconfig (attached as .config)
compiler: clang version 11.0.0 (git://gitmirror/llvm_project
14a1b80e044aac1947c891525cf30521be0a79b7)
reproduce:
# FIXME the reproduce steps for clang is not ready yet
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/gpu/drm/i915/i915_drv.c:30:
In file included from include/linux/acpi.h:35:
In file included from include/acpi/acpi_io.h:5:
In file included from include/linux/io.h:13:
In file included from arch/x86/include/asm/io.h:375:
> include/asm-generic/io.h:464:31: warning: performing pointer
arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:45: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu(__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro
'__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/gpu/drm/i915/i915_drv.c:30:
In file included from include/linux/acpi.h:35:
In file included from include/acpi/acpi_io.h:5:
In file included from include/linux/io.h:13:
In file included from arch/x86/include/asm/io.h:375:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro
'__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/gpu/drm/i915/i915_drv.c:30:
In file included from include/linux/acpi.h:35:
In file included from include/acpi/acpi_io.h:5:
In file included from include/linux/io.h:13:
In file included from arch/x86/include/asm/io.h:375:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:46: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew(cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:46: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
6 warnings generated.
--
In file included from drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:7:
In file included from include/linux/intel-iommu.h:14:
In file included from include/linux/iova.h:16:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/x86/include/asm/io.h:375:
> include/asm-generic/io.h:464:31: warning: performing pointer
arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:45: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu(__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro
'__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:7:
In file included from include/linux/intel-iommu.h:14:
In file included from include/linux/iova.h:16:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/x86/include/asm/io.h:375:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro
'__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:7:
In file included from include/linux/intel-iommu.h:14:
In file included from include/linux/iova.h:16:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/x86/include/asm/io.h:375:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:46: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew(cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:46: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1433:22: warning: result of comparison
of constant 576460752303423487 with expression of type 'unsigned int' is always
false [-Wtautological-constant-out-of-range-compare]
if (unlikely(remain > N_RELOC(ULONG_MAX)))
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
7 warnings generated.
--
In file included from drivers/gpu//drm/i915/gem/i915_gem_execbuffer.c:7:
In file included from include/linux/intel-iommu.h:14:
In file included from include/linux/iova.h:16:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/x86/include/asm/io.h:375:
> include/asm-generic/io.h:464:31: warning: performing pointer
arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:45: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu(__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro
'__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/gpu//drm/i915/gem/i915_gem_execbuffer.c:7:
In file included from include/linux/intel-iommu.h:14:
In file included from include/linux/iova.h:16:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/x86/include/asm/io.h:375:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro
'__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/gpu//drm/i915/gem/i915_gem_execbuffer.c:7:
In file included from include/linux/intel-iommu.h:14:
In file included from include/linux/iova.h:16:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/x86/include/asm/io.h:375:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:46: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew(cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:46: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
drivers/gpu//drm/i915/gem/i915_gem_execbuffer.c:1433:22: warning: result of comparison
of constant 576460752303423487 with expression of type 'unsigned int' is always
false [-Wtautological-constant-out-of-range-compare]
if (unlikely(remain > N_RELOC(ULONG_MAX)))
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
7 warnings 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
5ae6dd12ec6d6b John Garry 2020-03-18 457 #ifndef _inb
5ae6dd12ec6d6b John Garry 2020-03-18 458 #define _inb _inb
5ae6dd12ec6d6b John Garry 2020-03-18 459 static inline u16 _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 <okaya(a)codeaurora.org>
:::::: CC: Arnd Bergmann <arnd(a)arndb.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org