From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8322091318824993094==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [freescale-fslc:5.10-2.1.x-imx 1743/9999] drivers/pci/controller/dwc/pci-imx6.c:2938:29: warning: use of logical '&&' with constant operand Date: Fri, 07 Jan 2022 20:53:26 +0800 Message-ID: <202201072012.t1Lwxb9W-lkp@intel.com> List-Id: --===============8322091318824993094== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Richard, FYI, the error/warning still remains. tree: https://github.com/Freescale/linux-fslc 5.10-2.1.x-imx head: e730e691a1edb8c38004d81b070529224e8df714 commit: 1713c6ce909c5b8b54df3e9daa12d0e36eda86b7 [1743/9999] MLK-25283-4 PC= I: imx: adjust the l1ss support to proper place config: s390-randconfig-r044-20220107 (https://download.01.org/0day-ci/arch= ive/20220107/202201072012.t1Lwxb9W-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 32167b= fe64a4c5dd4eb3f7a58e24f4cba76f5ac2) reproduce (this is a W=3D1 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://github.com/Freescale/linux-fslc/commit/1713c6ce909c5b8b54= df3e9daa12d0e36eda86b7 git remote add freescale-fslc https://github.com/Freescale/linux-fs= lc git fetch --no-tags freescale-fslc 5.10-2.1.x-imx git checkout 1713c6ce909c5b8b54df3e9daa12d0e36eda86b7 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D= 1 O=3Dbuild_dir ARCH=3Ds390 SHELL=3D/bin/bash drivers/pci/controller/dwc/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from drivers/pci/controller/dwc/pci-imx6.c:15: In file included from include/linux/gpio.h:62: In file included from include/asm-generic/gpio.h:11: In file included from include/linux/gpio/driver.h:7: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/s390/include/asm/io.h:80: include/asm-generic/io.h:464:31: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val =3D __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:477:61: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val =3D __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + a= ddr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from mac= ro '__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/pci/controller/dwc/pci-imx6.c:15: In file included from include/linux/gpio.h:62: In file included from include/asm-generic/gpio.h:11: In file included from include/linux/gpio/driver.h:7: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/s390/include/asm/io.h:80: include/asm-generic/io.h:490:61: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val =3D __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + a= ddr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from mac= ro '__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/pci/controller/dwc/pci-imx6.c:15: In file included from include/linux/gpio.h:62: In file included from include/asm-generic/gpio.h:11: In file included from include/linux/gpio/driver.h:7: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/s390/include/asm/io.h:80: 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:59: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:521:59: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:609:20: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:617:20: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:625:20: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:634:21: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:643:21: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:652:21: warning: performing pointer arithmetic = on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ drivers/pci/controller/dwc/pci-imx6.c:2370:6: warning: unused variable '= reg' [-Wunused-variable] u32 reg; ^ >> drivers/pci/controller/dwc/pci-imx6.c:2938:29: warning: use of logical '= &&' with constant operand [-Wconstant-logical-operand] if ((rc_l1sub && ep_l1sub) && PCI_L1SS_CAP_L1_PM_SS) { ^ ~~~~~~~~~~~~~~~~~~~~~ drivers/pci/controller/dwc/pci-imx6.c:2938:29: note: use '&' for a bitwi= se operation if ((rc_l1sub && ep_l1sub) && PCI_L1SS_CAP_L1_PM_SS) { ^~ & drivers/pci/controller/dwc/pci-imx6.c:2938:29: note: remove constant to = silence this warning if ((rc_l1sub && ep_l1sub) && PCI_L1SS_CAP_L1_PM_SS) { ~^~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/pci/controller/dwc/pci-imx6.c:2902:11: warning: variable 'ret' s= et but not used [-Wunused-but-set-variable] int ttl, ret; ^ 15 warnings generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for INPUT_POLLDEV Depends on !UML && INPUT Selected by - MXC_MMA8451 && HWMON && I2C vim +2938 drivers/pci/controller/dwc/pci-imx6.c 2867 = 2868 static void imx6_pcie_quirk(struct pci_dev *dev) 2869 { 2870 struct pci_bus *bus =3D dev->bus; 2871 struct pcie_port *pp =3D bus->sysdata; 2872 = 2873 /* Bus parent is the PCI bridge, its parent is this platform driver= */ 2874 if (!bus->dev.parent || !bus->dev.parent->parent) 2875 return; 2876 = 2877 /* Make sure we only quirk devices associated with this driver */ 2878 if (bus->dev.parent->parent->driver !=3D &imx6_pcie_driver.driver) 2879 return; 2880 = 2881 if (pci_is_root_bus(bus)) { 2882 struct dw_pcie *pci =3D to_dw_pcie_from_pp(pp); 2883 struct imx6_pcie *imx6_pcie =3D to_imx6_pcie(pci); 2884 = 2885 /* 2886 * Limit config length to avoid the kernel reading beyond 2887 * the register set and causing an abort on i.MX 6Quad 2888 */ 2889 if (imx6_pcie->drvdata->dbi_length) { 2890 dev->cfg_size =3D imx6_pcie->drvdata->dbi_length; 2891 dev_info(&dev->dev, "Limiting cfg_size to %d\n", 2892 dev->cfg_size); 2893 } 2894 } 2895 } 2896 DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_SYNOPSYS, 0xabcd, 2897 PCI_CLASS_BRIDGE_PCI, 8, imx6_pcie_quirk); 2898 = 2899 static void imx6_pcie_l1ss_quirk(struct pci_dev *dev) 2900 { 2901 u32 reg, rc_l1sub, ep_l1sub, header; > 2902 int ttl, ret; 2903 int pos =3D PCI_CFG_SPACE_SIZE; 2904 struct pci_bus *bus =3D dev->bus; 2905 struct pcie_port *pp =3D bus->sysdata; 2906 struct dw_pcie *pci =3D to_dw_pcie_from_pp(pp); 2907 struct imx6_pcie *imx6_pcie =3D to_imx6_pcie(pci); 2908 = 2909 /* Return directly, if the L1SS is not supported by RC */ 2910 if (!(imx6_pcie->drvdata->flags & IMX6_PCIE_FLAG_SUPPORTS_L1SS)) 2911 return; 2912 = 2913 reg =3D dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_L1SS); 2914 rc_l1sub =3D dw_pcie_readl_dbi(pci, reg + PCI_L1SS_CAP); 2915 = 2916 /* minimum 8 bytes per capability */ 2917 ttl =3D (PCI_CFG_SPACE_EXP_SIZE - PCI_CFG_SPACE_SIZE) / 8; 2918 ret =3D dw_pcie_read(pp->va_cfg0_base + pos, 4, &header); 2919 /* 2920 * If we have no capabilities, this is indicated by cap ID, 2921 * cap version and next pointer all being 0. 2922 */ 2923 if (header =3D=3D 0) 2924 return; 2925 = 2926 while (ttl-- > 0) { 2927 if (PCI_EXT_CAP_ID(header) =3D=3D PCI_EXT_CAP_ID_L1SS && pos !=3D = 0) 2928 break; 2929 = 2930 pos =3D PCI_EXT_CAP_NEXT(header); 2931 if (pos < PCI_CFG_SPACE_SIZE) 2932 break; 2933 = 2934 ret =3D dw_pcie_read(pp->va_cfg0_base + pos, 4, &header); 2935 } 2936 ret =3D dw_pcie_read(pp->va_cfg0_base + pos + PCI_L1SS_CAP, 4, &ep_= l1sub); 2937 = > 2938 if ((rc_l1sub && ep_l1sub) && PCI_L1SS_CAP_L1_PM_SS) { 2939 imx6_pcie->l1ss_clkreq =3D 1; 2940 imx6_pcie_clkreq_enable(imx6_pcie); 2941 } else { 2942 imx6_pcie->l1ss_clkreq =3D 0; 2943 } 2944 } 2945 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SYNOPSYS, 0xabcd, imx6_pcie_l1= ss_quirk); 2946 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============8322091318824993094==--