[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210010324.iMLSqeOw-lkp@intel.com>
Date: Sat, 1 Oct 2022 03:10:17 +0800
From: kernel test robot <lkp@...el.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [driver-core:kobject-const 15/18] drivers/s390/cio/device.c:133:52:
error: passing 'const struct ccw_device_id *' to parameter of type 'struct
ccw_device_id *' discards qualifiers
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git kobject-const
head: b3fd2c1b72aa7f7a66de071d625c3702f705edf7
commit: 50a40710ce9ffdc860cd60c3d797388781b6fd2e [15/18] driver core: make struct bus_type.uevent() take a const *
config: s390-randconfig-r015-20220926
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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/gregkh/driver-core.git/commit/?id=50a40710ce9ffdc860cd60c3d797388781b6fd2e
git remote add driver-core https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
git fetch --no-tags driver-core kobject-const
git checkout 50a40710ce9ffdc860cd60c3d797388781b6fd2e
# 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 SHELL=/bin/bash drivers/s390/cio/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
In file included from drivers/s390/cio/device.c:27:
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:547: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:560: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: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/s390/cio/device.c:27:
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:573: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: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/s390/cio/device.c:27:
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:584: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:594: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:604: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:692: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:700: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:708: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:717: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:726: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:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/s390/cio/device.c:133:52: error: passing 'const struct ccw_device_id *' to parameter of type 'struct ccw_device_id *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
snprint_alias(modalias_buf, sizeof(modalias_buf), id, "");
^~
drivers/s390/cio/device.c:83:27: note: passing argument to parameter 'id' here
struct ccw_device_id *id, const char *suffix)
^
12 warnings and 1 error generated.
vim +133 drivers/s390/cio/device.c
db0c2d59087296 Peter Oberparleiter 2006-09-20 101
db0c2d59087296 Peter Oberparleiter 2006-09-20 102 /* Set up environment variables for ccw device uevent. Return 0 on success,
db0c2d59087296 Peter Oberparleiter 2006-09-20 103 * non-zero otherwise. */
50a40710ce9ffd Greg Kroah-Hartman 2022-09-29 104 static int ccw_uevent(const struct device *dev, struct kobj_uevent_env *env)
^1da177e4c3f41 Linus Torvalds 2005-04-16 105 {
50a40710ce9ffd Greg Kroah-Hartman 2022-09-29 106 const struct ccw_device *cdev = to_ccwdev(dev);
50a40710ce9ffd Greg Kroah-Hartman 2022-09-29 107 const struct ccw_device_id *id = &(cdev->id);
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 108 int ret;
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 109 char modalias_buf[30];
^1da177e4c3f41 Linus Torvalds 2005-04-16 110
db0c2d59087296 Peter Oberparleiter 2006-09-20 111 /* CU_TYPE= */
7eff2e7a8b65c2 Kay Sievers 2007-08-14 112 ret = add_uevent_var(env, "CU_TYPE=%04X", id->cu_type);
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 113 if (ret)
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 114 return ret;
db0c2d59087296 Peter Oberparleiter 2006-09-20 115
db0c2d59087296 Peter Oberparleiter 2006-09-20 116 /* CU_MODEL= */
7eff2e7a8b65c2 Kay Sievers 2007-08-14 117 ret = add_uevent_var(env, "CU_MODEL=%02X", id->cu_model);
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 118 if (ret)
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 119 return ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 120
^1da177e4c3f41 Linus Torvalds 2005-04-16 121 /* The next two can be zero, that's ok for us */
db0c2d59087296 Peter Oberparleiter 2006-09-20 122 /* DEV_TYPE= */
7eff2e7a8b65c2 Kay Sievers 2007-08-14 123 ret = add_uevent_var(env, "DEV_TYPE=%04X", id->dev_type);
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 124 if (ret)
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 125 return ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 126
db0c2d59087296 Peter Oberparleiter 2006-09-20 127 /* DEV_MODEL= */
7eff2e7a8b65c2 Kay Sievers 2007-08-14 128 ret = add_uevent_var(env, "DEV_MODEL=%02X", id->dev_model);
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 129 if (ret)
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 130 return ret;
db0c2d59087296 Peter Oberparleiter 2006-09-20 131
db0c2d59087296 Peter Oberparleiter 2006-09-20 132 /* MODALIAS= */
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 @133 snprint_alias(modalias_buf, sizeof(modalias_buf), id, "");
7eff2e7a8b65c2 Kay Sievers 2007-08-14 134 ret = add_uevent_var(env, "MODALIAS=%s", modalias_buf);
cfbe9bb2fb5de1 Cornelia Huck 2007-04-27 135 return ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 136 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 137
:::::: The code at line 133 was first introduced by commit
:::::: cfbe9bb2fb5de1da58d351432a9465c22d6d3ee5 [S390] cio: Use add_uevent_var.
:::::: TO: Cornelia Huck <cornelia.huck@...ibm.com>
:::::: CC: Martin Schwidefsky <schwidefsky@...ibm.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (63771 bytes)
Powered by blists - more mailing lists