* [arnd-playground:randconfig-v5.12 390/597] arch/s390/pci/pci_bus.c:219:3: warning: variable 'bridge' is uninitialized when used here
@ 2021-03-19 18:26 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-19 18:26 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 12825 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git randconfig-v5.12
head: fd21c2581b744639b5207c11651ab40abf13701a
commit: aeb172ab4efb38a4817cf99c9c977d89130c3937 [390/597] pci: s390: remove redundant zbus->bus member
config: s390-randconfig-r001-20210318 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project fcc1ce00931751ac02498986feb37744e9ace8de)
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/arnd/playground.git/commit/?id=aeb172ab4efb38a4817cf99c9c977d89130c3937
git remote add arnd-playground https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
git fetch --no-tags arnd-playground randconfig-v5.12
git checkout aeb172ab4efb38a4817cf99c9c977d89130c3937
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
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 arch/s390/pci/pci_bus.c:14:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:84:
arch/s390/include/asm/smp.h:42:1: warning: function 'smp_stop_cpu' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
{
^
In file included from arch/s390/pci/pci_bus.c:20:
In file included from include/linux/pci.h:39:
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 = __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 = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:36: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 arch/s390/pci/pci_bus.c:20:
In file included from include/linux/pci.h:39:
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 = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34: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 arch/s390/pci/pci_bus.c:20:
In file included from include/linux/pci.h:39:
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);
~~~~~~~~~~ ^
>> arch/s390/pci/pci_bus.c:219:3: warning: variable 'bridge' is uninitialized when used here [-Wuninitialized]
bridge->ops = ops;
^~~~~~
arch/s390/pci/pci_bus.c:198:32: note: initialize the variable 'bridge' to silence this warning
struct pci_host_bridge *bridge;
^
= NULL
14 warnings generated.
vim +/bridge +219 arch/s390/pci/pci_bus.c
44510d6fa0c00a Pierre Morel 2020-04-22 195
44510d6fa0c00a Pierre Morel 2020-04-22 196 int zpci_bus_device_register(struct zpci_dev *zdev, struct pci_ops *ops)
44510d6fa0c00a Pierre Morel 2020-04-22 197 {
a33ad04d2320ed Arnd Bergmann 2020-12-18 198 struct pci_host_bridge *bridge;
44510d6fa0c00a Pierre Morel 2020-04-22 199 struct zpci_bus *zbus = NULL;
44510d6fa0c00a Pierre Morel 2020-04-22 200 int rc = -EBADF;
44510d6fa0c00a Pierre Morel 2020-04-22 201
05bc1be6db4b26 Pierre Morel 2020-03-23 202 if (zpci_nb_devices == ZPCI_NR_DEVICES) {
05bc1be6db4b26 Pierre Morel 2020-03-23 203 pr_warn("Adding PCI function %08x failed because the configured limit of %d is reached\n",
05bc1be6db4b26 Pierre Morel 2020-03-23 204 zdev->fid, ZPCI_NR_DEVICES);
05bc1be6db4b26 Pierre Morel 2020-03-23 205 return -ENOSPC;
05bc1be6db4b26 Pierre Morel 2020-03-23 206 }
05bc1be6db4b26 Pierre Morel 2020-03-23 207 zpci_nb_devices++;
05bc1be6db4b26 Pierre Morel 2020-03-23 208
44510d6fa0c00a Pierre Morel 2020-04-22 209 if (zdev->devfn >= ZPCI_FUNCTIONS_PER_BUS)
05bc1be6db4b26 Pierre Morel 2020-03-23 210 return -EINVAL;
05bc1be6db4b26 Pierre Morel 2020-03-23 211
44510d6fa0c00a Pierre Morel 2020-04-22 212 if (!s390_pci_no_rid && zdev->rid_available)
44510d6fa0c00a Pierre Morel 2020-04-22 213 zbus = zpci_bus_get(zdev->pchid);
44510d6fa0c00a Pierre Morel 2020-04-22 214
44510d6fa0c00a Pierre Morel 2020-04-22 215 if (!zbus) {
05bc1be6db4b26 Pierre Morel 2020-03-23 216 zbus = zpci_bus_alloc(zdev->pchid);
05bc1be6db4b26 Pierre Morel 2020-03-23 217 if (!zbus)
05bc1be6db4b26 Pierre Morel 2020-03-23 218 return -ENOMEM;
a33ad04d2320ed Arnd Bergmann 2020-12-18 @219 bridge->ops = ops;
44510d6fa0c00a Pierre Morel 2020-04-22 220 }
05bc1be6db4b26 Pierre Morel 2020-03-23 221
05bc1be6db4b26 Pierre Morel 2020-03-23 222 zdev->zbus = zbus;
a33ad04d2320ed Arnd Bergmann 2020-12-18 223
44510d6fa0c00a Pierre Morel 2020-04-22 224 if (zbus->function[zdev->devfn]) {
44510d6fa0c00a Pierre Morel 2020-04-22 225 pr_err("devfn %04x is already assigned\n", zdev->devfn);
44510d6fa0c00a Pierre Morel 2020-04-22 226 goto error; /* rc already set */
44510d6fa0c00a Pierre Morel 2020-04-22 227 }
44510d6fa0c00a Pierre Morel 2020-04-22 228 zbus->function[zdev->devfn] = zdev;
05bc1be6db4b26 Pierre Morel 2020-03-23 229
a33ad04d2320ed Arnd Bergmann 2020-12-18 230 zpci_setup_bus_resources(zdev, &zbus->bridge->windows);
05bc1be6db4b26 Pierre Morel 2020-03-23 231
aeb172ab4efb38 Arnd Bergmann 2021-01-25 232 if (zbus->bridge->bus) {
44510d6fa0c00a Pierre Morel 2020-04-22 233 if (!zbus->multifunction) {
44510d6fa0c00a Pierre Morel 2020-04-22 234 WARN_ONCE(1, "zbus is not multifunction\n");
44510d6fa0c00a Pierre Morel 2020-04-22 235 goto error_bus;
44510d6fa0c00a Pierre Morel 2020-04-22 236 }
44510d6fa0c00a Pierre Morel 2020-04-22 237 if (!zdev->rid_available) {
44510d6fa0c00a Pierre Morel 2020-04-22 238 WARN_ONCE(1, "rid_available not set for multifunction\n");
44510d6fa0c00a Pierre Morel 2020-04-22 239 goto error_bus;
44510d6fa0c00a Pierre Morel 2020-04-22 240 }
44510d6fa0c00a Pierre Morel 2020-04-22 241 rc = zpci_bus_add_device(zbus, zdev);
44510d6fa0c00a Pierre Morel 2020-04-22 242 if (rc)
44510d6fa0c00a Pierre Morel 2020-04-22 243 goto error_bus;
44510d6fa0c00a Pierre Morel 2020-04-22 244 } else if (zdev->devfn == 0) {
44510d6fa0c00a Pierre Morel 2020-04-22 245 if (zbus->multifunction && !zdev->rid_available) {
44510d6fa0c00a Pierre Morel 2020-04-22 246 WARN_ONCE(1, "rid_available not set on function 0 for multifunction\n");
44510d6fa0c00a Pierre Morel 2020-04-22 247 goto error_bus;
44510d6fa0c00a Pierre Morel 2020-04-22 248 }
aeb172ab4efb38 Arnd Bergmann 2021-01-25 249 rc = zpci_bus_scan(zbus, (u16)zdev->uid);
44510d6fa0c00a Pierre Morel 2020-04-22 250 if (rc)
44510d6fa0c00a Pierre Morel 2020-04-22 251 goto error_bus;
44510d6fa0c00a Pierre Morel 2020-04-22 252 zpci_bus_add_devices(zbus);
44510d6fa0c00a Pierre Morel 2020-04-22 253 rc = zpci_init_slot(zdev);
44510d6fa0c00a Pierre Morel 2020-04-22 254 if (rc)
44510d6fa0c00a Pierre Morel 2020-04-22 255 goto error_bus;
44510d6fa0c00a Pierre Morel 2020-04-22 256 zdev->has_hp_slot = 1;
44510d6fa0c00a Pierre Morel 2020-04-22 257 zbus->multifunction = zdev->rid_available;
44510d6fa0c00a Pierre Morel 2020-04-22 258 zbus->max_bus_speed = zdev->max_bus_speed;
44510d6fa0c00a Pierre Morel 2020-04-22 259 } else {
44510d6fa0c00a Pierre Morel 2020-04-22 260 zbus->multifunction = 1;
44510d6fa0c00a Pierre Morel 2020-04-22 261 }
44510d6fa0c00a Pierre Morel 2020-04-22 262
05bc1be6db4b26 Pierre Morel 2020-03-23 263 return 0;
05bc1be6db4b26 Pierre Morel 2020-03-23 264
44510d6fa0c00a Pierre Morel 2020-04-22 265 error_bus:
44510d6fa0c00a Pierre Morel 2020-04-22 266 zpci_nb_devices--;
44510d6fa0c00a Pierre Morel 2020-04-22 267 zbus->function[zdev->devfn] = NULL;
44510d6fa0c00a Pierre Morel 2020-04-22 268 error:
05bc1be6db4b26 Pierre Morel 2020-03-23 269 pr_err("Adding PCI function %08x failed\n", zdev->fid);
05bc1be6db4b26 Pierre Morel 2020-03-23 270 zpci_bus_put(zbus);
05bc1be6db4b26 Pierre Morel 2020-03-23 271 return rc;
05bc1be6db4b26 Pierre Morel 2020-03-23 272 }
05bc1be6db4b26 Pierre Morel 2020-03-23 273
:::::: The code at line 219 was first introduced by commit
:::::: a33ad04d2320edeaca80d61524768a9b7b7af8e4 s390: simplify PCI bus scan
:::::: TO: Arnd Bergmann <arnd@arndb.de>
:::::: CC: Arnd Bergmann <arnd@arndb.de>
---
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: 23303 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-19 18:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 18:26 [arnd-playground:randconfig-v5.12 390/597] arch/s390/pci/pci_bus.c:219:3: warning: variable 'bridge' is uninitialized when used here kernel test robot
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.