drivers/tty/ipwireless/hardware.c:431:30: sparse: sparse: incorrect type in argument 1 (different base types)

From: kernel test robot
Date: Fri Aug 07 2020 - 05:50:08 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 86cfccb66937dd6cbf26ed619958b9e587e6a115
commit: 05933aac7b11911955de307a329dc2a7a14b7bd0 ia64: remove now unused machvec indirections
date: 12 months ago
config: ia64-randconfig-s031-20200807 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-118-ge1578773-dirty
git checkout 05933aac7b11911955de307a329dc2a7a14b7bd0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> drivers/tty/ipwireless/hardware.c:431:30: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short val @@ got restricted __le16 [assigned] [usertype] raw_data @@
>> drivers/tty/ipwireless/hardware.c:431:30: sparse: expected unsigned short val
drivers/tty/ipwireless/hardware.c:431:30: sparse: got restricted __le16 [assigned] [usertype] raw_data
drivers/tty/ipwireless/hardware.c:445:30: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short val @@ got restricted __le16 [assigned] [usertype] raw_data @@
drivers/tty/ipwireless/hardware.c:445:30: sparse: expected unsigned short val
drivers/tty/ipwireless/hardware.c:445:30: sparse: got restricted __le16 [assigned] [usertype] raw_data
drivers/tty/ipwireless/hardware.c:872:46: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le16 [usertype] raw_data @@ got unsigned int @@
drivers/tty/ipwireless/hardware.c:872:46: sparse: expected restricted __le16 [usertype] raw_data
drivers/tty/ipwireless/hardware.c:872:46: sparse: got unsigned int
drivers/tty/ipwireless/hardware.c:889:46: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le16 [usertype] raw_data @@ got unsigned int @@
drivers/tty/ipwireless/hardware.c:889:46: sparse: expected restricted __le16 [usertype] raw_data
drivers/tty/ipwireless/hardware.c:889:46: sparse: got unsigned int
drivers/tty/ipwireless/hardware.c: note: in included file (through arch/ia64/include/asm/io.h, arch/ia64/include/asm/smp.h, include/linux/smp.h, ...):
include/asm-generic/io.h:215:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:215:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:215:22: sparse: got restricted __le16 [usertype]
include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:215:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:215:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:215:22: sparse: got restricted __le16 [usertype]
include/asm-generic/io.h:215:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:215:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:215:22: sparse: got restricted __le16 [usertype]
include/asm-generic/io.h:215:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:215:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:215:22: sparse: got restricted __le16 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:215:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:215:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:215:22: sparse: got restricted __le16 [usertype]
include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:215:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:215:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:215:22: sparse: got restricted __le16 [usertype]
include/asm-generic/io.h:215:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:215:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:215:22: sparse: got restricted __le16 [usertype]
include/asm-generic/io.h:215:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:215:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:215:22: sparse: got restricted __le16 [usertype]

vim +431 drivers/tty/ipwireless/hardware.c

d54c2752f6bb6c drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 403
93110f698fe92f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 404 static void do_send_fragment(struct ipw_hardware *hw, unsigned char *data,
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 405 unsigned length)
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 406 {
d4c0deb7009217 drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 407 unsigned i;
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 408 unsigned long flags;
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 409
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 410 start_timing();
93110f698fe92f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 411 BUG_ON(length > hw->ll_mtu);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 412
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 413 if (ipwireless_debug)
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 414 dump_data_bytes("send", data, length);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 415
63c4dbd1023b9a drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 416 spin_lock_irqsave(&hw->lock, flags);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 417
eb4e545d4ac82d drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-06-06 418 hw->tx_ready = 0;
d54c2752f6bb6c drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 419 swap_packet_bitfield_to_le(data);
eb4e545d4ac82d drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-06-06 420
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 421 if (hw->hw_version == HW_VERSION_1) {
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 422 outw((unsigned short) length, hw->base_port + IODWR);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 423
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 424 for (i = 0; i < length; i += 2) {
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 425 unsigned short d = data[i];
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 426 __le16 raw_data;
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 427
d4c0deb7009217 drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 428 if (i + 1 < length)
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 429 d |= data[i + 1] << 8;
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 430 raw_data = cpu_to_le16(d);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 @431 outw(raw_data, hw->base_port + IODWR);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 432 }
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 433
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 434 outw(DCR_TXDONE, hw->base_port + IODCR);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 435 } else if (hw->hw_version == HW_VERSION_2) {
2e713165f892c8 drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 436 outw((unsigned short) length, hw->base_port);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 437
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 438 for (i = 0; i < length; i += 2) {
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 439 unsigned short d = data[i];
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 440 __le16 raw_data;
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 441
d4c0deb7009217 drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 442 if (i + 1 < length)
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 443 d |= data[i + 1] << 8;
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 444 raw_data = cpu_to_le16(d);
2e713165f892c8 drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 445 outw(raw_data, hw->base_port);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 446 }
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 447 while ((i & 3) != 2) {
2e713165f892c8 drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 448 outw((unsigned short) 0xDEAD, hw->base_port);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 449 i += 2;
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 450 }
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 451 writew(MEMRX_RX, &hw->memory_info_regs->memreg_rx);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 452 }
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 453
63c4dbd1023b9a drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-07-28 454 spin_unlock_irqrestore(&hw->lock, flags);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 455
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 456 end_write_timing(length);
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 457 }
099dc4fb62653f drivers/char/pcmcia/ipwireless/hardware.c David Sterba 2008-02-07 458

:::::: The code at line 431 was first introduced by commit
:::::: 099dc4fb62653f6019d78db55fba7a18ef02d65b ipwireless: driver for PC Card 3G/UMTS modem

:::::: TO: David Sterba <dsterba@xxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip