[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202008061024.CfgVFa5E%lkp@intel.com>
Date: Thu, 6 Aug 2020 10:17:29 +0800
From: kernel test robot <lkp@...el.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
kvm@...r.kernel.org, virtualization@...ts.linux-foundation.org,
netdev@...r.kernel.org
Subject: [vhost:vhost 32/65] drivers/virtio/virtio_input.c:247:3: warning:
comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v),
__u8: (virtio_cread_v), __le16:
(__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v)))
((__u16)((((__u16)((__u16)(__le16)(vi...
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost
head: 1a86b377aa2147a7c866b03142e848c18e5f3cb8
commit: b025584098e621d88894d28e80af686958e273af [32/65] virtio_input: convert to LE accessors
config: powerpc-randconfig-r031-20200805 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 076b120bebfd727b502208601012a44ab2e1028e)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
git checkout b025584098e621d88894d28e80af686958e273af
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/virtio/virtio_input.c:247:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v))) ? ((__u16)((((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)255U) << 8) | (((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)65280U) >> 8))) : __fswab16((__u16)(__le16)(virtio_cread_v))), __le32: (__builtin_constant_p((__u32)((__u32)(__le32)(virtio_cread_v))) ? ((__u32)((((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)255UL) << 24) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)65280UL) << 8) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)16711680UL) >> 8) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)4278190080UL) >> 24))) : __fswab32((__u32)(__le32)(virtio_cread_v))), __le64: (__builtin_constant_p((__u64)((__u64)(__le64)(virtio_cread_v))) ? ((__u64)((((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)255ULL) << 56) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)65280ULL) << 40) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)16711680ULL) << 24) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)4278190080ULL) << 8) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)1095216660480ULL) >> 8) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)280375465082880ULL) >> 24) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)71776119061217280ULL) >> 40) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)18374686479671623680ULL) >> 56))) : __fswab64((__u64)(__le64)(virtio_cread_v))))) *' (aka 'int *') and 'typeof (*(&vi->idev->id.bustype)) *' (aka 'unsigned short *')) [-Wcompare-distinct-pointer-types]
virtio_cread_le(vi->vdev, struct virtio_input_config,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/virtio_config.h:405:3: note: expanded from macro 'virtio_cread_le'
typecheck(typeof(virtio_le_to_cpu(virtio_cread_v)), *(ptr)); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/typecheck.h:12:18: note: expanded from macro 'typecheck'
(void)(&__dummy == &__dummy2); \
~~~~~~~~ ^ ~~~~~~~~~
drivers/virtio/virtio_input.c:249:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v))) ? ((__u16)((((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)255U) << 8) | (((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)65280U) >> 8))) : __fswab16((__u16)(__le16)(virtio_cread_v))), __le32: (__builtin_constant_p((__u32)((__u32)(__le32)(virtio_cread_v))) ? ((__u32)((((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)255UL) << 24) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)65280UL) << 8) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)16711680UL) >> 8) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)4278190080UL) >> 24))) : __fswab32((__u32)(__le32)(virtio_cread_v))), __le64: (__builtin_constant_p((__u64)((__u64)(__le64)(virtio_cread_v))) ? ((__u64)((((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)255ULL) << 56) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)65280ULL) << 40) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)16711680ULL) << 24) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)4278190080ULL) << 8) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)1095216660480ULL) >> 8) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)280375465082880ULL) >> 24) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)71776119061217280ULL) >> 40) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)18374686479671623680ULL) >> 56))) : __fswab64((__u64)(__le64)(virtio_cread_v))))) *' (aka 'int *') and 'typeof (*(&vi->idev->id.vendor)) *' (aka 'unsigned short *')) [-Wcompare-distinct-pointer-types]
virtio_cread_le(vi->vdev, struct virtio_input_config,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/virtio_config.h:405:3: note: expanded from macro 'virtio_cread_le'
typecheck(typeof(virtio_le_to_cpu(virtio_cread_v)), *(ptr)); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/typecheck.h:12:18: note: expanded from macro 'typecheck'
(void)(&__dummy == &__dummy2); \
~~~~~~~~ ^ ~~~~~~~~~
drivers/virtio/virtio_input.c:251:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v))) ? ((__u16)((((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)255U) << 8) | (((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)65280U) >> 8))) : __fswab16((__u16)(__le16)(virtio_cread_v))), __le32: (__builtin_constant_p((__u32)((__u32)(__le32)(virtio_cread_v))) ? ((__u32)((((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)255UL) << 24) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)65280UL) << 8) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)16711680UL) >> 8) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)4278190080UL) >> 24))) : __fswab32((__u32)(__le32)(virtio_cread_v))), __le64: (__builtin_constant_p((__u64)((__u64)(__le64)(virtio_cread_v))) ? ((__u64)((((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)255ULL) << 56) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)65280ULL) << 40) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)16711680ULL) << 24) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)4278190080ULL) << 8) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)1095216660480ULL) >> 8) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)280375465082880ULL) >> 24) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)71776119061217280ULL) >> 40) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)18374686479671623680ULL) >> 56))) : __fswab64((__u64)(__le64)(virtio_cread_v))))) *' (aka 'int *') and 'typeof (*(&vi->idev->id.product)) *' (aka 'unsigned short *')) [-Wcompare-distinct-pointer-types]
virtio_cread_le(vi->vdev, struct virtio_input_config,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/virtio_config.h:405:3: note: expanded from macro 'virtio_cread_le'
typecheck(typeof(virtio_le_to_cpu(virtio_cread_v)), *(ptr)); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/typecheck.h:12:18: note: expanded from macro 'typecheck'
(void)(&__dummy == &__dummy2); \
~~~~~~~~ ^ ~~~~~~~~~
drivers/virtio/virtio_input.c:253:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v))) ? ((__u16)((((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)255U) << 8) | (((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)65280U) >> 8))) : __fswab16((__u16)(__le16)(virtio_cread_v))), __le32: (__builtin_constant_p((__u32)((__u32)(__le32)(virtio_cread_v))) ? ((__u32)((((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)255UL) << 24) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)65280UL) << 8) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)16711680UL) >> 8) | (((__u32)((__u32)(__le32)(virtio_cread_v)) & (__u32)4278190080UL) >> 24))) : __fswab32((__u32)(__le32)(virtio_cread_v))), __le64: (__builtin_constant_p((__u64)((__u64)(__le64)(virtio_cread_v))) ? ((__u64)((((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)255ULL) << 56) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)65280ULL) << 40) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)16711680ULL) << 24) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)4278190080ULL) << 8) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)1095216660480ULL) >> 8) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)280375465082880ULL) >> 24) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)71776119061217280ULL) >> 40) | (((__u64)((__u64)(__le64)(virtio_cread_v)) & (__u64)18374686479671623680ULL) >> 56))) : __fswab64((__u64)(__le64)(virtio_cread_v))))) *' (aka 'int *') and 'typeof (*(&vi->idev->id.version)) *' (aka 'unsigned short *')) [-Wcompare-distinct-pointer-types]
virtio_cread_le(vi->vdev, struct virtio_input_config,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/virtio_config.h:405:3: note: expanded from macro 'virtio_cread_le'
typecheck(typeof(virtio_le_to_cpu(virtio_cread_v)), *(ptr)); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/typecheck.h:12:18: note: expanded from macro 'typecheck'
(void)(&__dummy == &__dummy2); \
~~~~~~~~ ^ ~~~~~~~~~
4 warnings generated.
vim +247 drivers/virtio/virtio_input.c
201
202 static int virtinput_probe(struct virtio_device *vdev)
203 {
204 struct virtio_input *vi;
205 unsigned long flags;
206 size_t size;
207 int abs, err;
208
209 if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1))
210 return -ENODEV;
211
212 vi = kzalloc(sizeof(*vi), GFP_KERNEL);
213 if (!vi)
214 return -ENOMEM;
215
216 vdev->priv = vi;
217 vi->vdev = vdev;
218 spin_lock_init(&vi->lock);
219
220 err = virtinput_init_vqs(vi);
221 if (err)
222 goto err_init_vq;
223
224 vi->idev = input_allocate_device();
225 if (!vi->idev) {
226 err = -ENOMEM;
227 goto err_input_alloc;
228 }
229 input_set_drvdata(vi->idev, vi);
230
231 size = virtinput_cfg_select(vi, VIRTIO_INPUT_CFG_ID_NAME, 0);
232 virtio_cread_bytes(vi->vdev, offsetof(struct virtio_input_config,
233 u.string),
234 vi->name, min(size, sizeof(vi->name)));
235 size = virtinput_cfg_select(vi, VIRTIO_INPUT_CFG_ID_SERIAL, 0);
236 virtio_cread_bytes(vi->vdev, offsetof(struct virtio_input_config,
237 u.string),
238 vi->serial, min(size, sizeof(vi->serial)));
239 snprintf(vi->phys, sizeof(vi->phys),
240 "virtio%d/input0", vdev->index);
241 vi->idev->name = vi->name;
242 vi->idev->phys = vi->phys;
243 vi->idev->uniq = vi->serial;
244
245 size = virtinput_cfg_select(vi, VIRTIO_INPUT_CFG_ID_DEVIDS, 0);
246 if (size >= sizeof(struct virtio_input_devids)) {
> 247 virtio_cread_le(vi->vdev, struct virtio_input_config,
248 u.ids.bustype, &vi->idev->id.bustype);
249 virtio_cread_le(vi->vdev, struct virtio_input_config,
250 u.ids.vendor, &vi->idev->id.vendor);
251 virtio_cread_le(vi->vdev, struct virtio_input_config,
252 u.ids.product, &vi->idev->id.product);
253 virtio_cread_le(vi->vdev, struct virtio_input_config,
254 u.ids.version, &vi->idev->id.version);
255 } else {
256 vi->idev->id.bustype = BUS_VIRTUAL;
257 }
258
259 virtinput_cfg_bits(vi, VIRTIO_INPUT_CFG_PROP_BITS, 0,
260 vi->idev->propbit, INPUT_PROP_CNT);
261 size = virtinput_cfg_select(vi, VIRTIO_INPUT_CFG_EV_BITS, EV_REP);
262 if (size)
263 __set_bit(EV_REP, vi->idev->evbit);
264
265 vi->idev->dev.parent = &vdev->dev;
266 vi->idev->event = virtinput_status;
267
268 /* device -> kernel */
269 virtinput_cfg_bits(vi, VIRTIO_INPUT_CFG_EV_BITS, EV_KEY,
270 vi->idev->keybit, KEY_CNT);
271 virtinput_cfg_bits(vi, VIRTIO_INPUT_CFG_EV_BITS, EV_REL,
272 vi->idev->relbit, REL_CNT);
273 virtinput_cfg_bits(vi, VIRTIO_INPUT_CFG_EV_BITS, EV_ABS,
274 vi->idev->absbit, ABS_CNT);
275 virtinput_cfg_bits(vi, VIRTIO_INPUT_CFG_EV_BITS, EV_MSC,
276 vi->idev->mscbit, MSC_CNT);
277 virtinput_cfg_bits(vi, VIRTIO_INPUT_CFG_EV_BITS, EV_SW,
278 vi->idev->swbit, SW_CNT);
279
280 /* kernel -> device */
281 virtinput_cfg_bits(vi, VIRTIO_INPUT_CFG_EV_BITS, EV_LED,
282 vi->idev->ledbit, LED_CNT);
283 virtinput_cfg_bits(vi, VIRTIO_INPUT_CFG_EV_BITS, EV_SND,
284 vi->idev->sndbit, SND_CNT);
285
286 if (test_bit(EV_ABS, vi->idev->evbit)) {
287 for (abs = 0; abs < ABS_CNT; abs++) {
288 if (!test_bit(abs, vi->idev->absbit))
289 continue;
290 virtinput_cfg_abs(vi, abs);
291 }
292 }
293
294 virtio_device_ready(vdev);
295 vi->ready = true;
296 err = input_register_device(vi->idev);
297 if (err)
298 goto err_input_register;
299
300 virtinput_fill_evt(vi);
301 return 0;
302
303 err_input_register:
304 spin_lock_irqsave(&vi->lock, flags);
305 vi->ready = false;
306 spin_unlock_irqrestore(&vi->lock, flags);
307 input_free_device(vi->idev);
308 err_input_alloc:
309 vdev->config->del_vqs(vdev);
310 err_init_vq:
311 kfree(vi);
312 return err;
313 }
314
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (25527 bytes)
Powered by blists - more mailing lists