drivers/ata/pata_parport/comm.c:135:59: sparse: sparse: cast to restricted __le16

From: kernel test robot
Date: Thu Dec 14 2023 - 22:08:55 EST


Hi Ondrej,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 976600c6da56c488776c9ee2a5733ae9736e2a75
commit: 72f2b0b2185099dce354c805009f591dda3ab73d drivers/block: Move PARIDE protocol modules to drivers/ata/pata_parport
date: 11 months ago
config: m68k-randconfig-r113-20231215 (https://download.01.org/0day-ci/archive/20231215/202312151114.XNGZXP20-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231215/202312151114.XNGZXP20-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312151114.XNGZXP20-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/ata/pata_parport/comm.c:135:59: sparse: sparse: cast to restricted __le16
>> drivers/ata/pata_parport/comm.c:135:59: sparse: sparse: cast to restricted __le16
>> drivers/ata/pata_parport/comm.c:135:59: sparse: sparse: cast to restricted __le16
>> drivers/ata/pata_parport/comm.c:135:59: sparse: sparse: cast to restricted __le16
drivers/ata/pata_parport/comm.c: note: in included file (through arch/m68k/include/asm/io.h):
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
--
>> drivers/ata/pata_parport/epat.c:146:62: sparse: sparse: cast to restricted __le16
>> drivers/ata/pata_parport/epat.c:146:62: sparse: sparse: cast to restricted __le16
>> drivers/ata/pata_parport/epat.c:146:62: sparse: sparse: cast to restricted __le16
>> drivers/ata/pata_parport/epat.c:146:62: sparse: sparse: cast to restricted __le16
drivers/ata/pata_parport/epat.c: note: in included file (through arch/m68k/include/asm/io.h):
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer
arch/m68k/include/asm/io_mm.h:166:21: sparse: sparse: Using plain integer as NULL pointer

vim +135 drivers/ata/pata_parport/comm.c

^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 111
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 112 switch (pi->mode) {
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 113
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 114 case 0: w0(0x48); P1;
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 115 for(i=0;i<count;i++) {
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 116 w0(0); w2(6); l = r1();
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 117 w0(0x80); h = r1(); w2(4);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 118 buf[i] = j44(l,h);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 119 }
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 120 break;
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 121
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 122 case 1: w0(0x68); P1; w0(0);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 123 for(i=0;i<count;i++) {
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 124 w2(0x26); buf[i] = r0(); w2(0x24);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 125 }
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 126 w2(4);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 127 break;
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 128
10e705f83c3e79 drivers/block/paride/comm.c Takashi Iwai 2006-03-24 129 case 2: w3(0x68); (void)r1(); w2(0x24);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 130 for (i=0;i<count;i++) buf[i] = r4();
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 131 w2(4);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 132 break;
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 133
10e705f83c3e79 drivers/block/paride/comm.c Takashi Iwai 2006-03-24 134 case 3: w3(0x68); (void)r1(); w2(0x24);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 @135 for (i=0;i<count/2;i++) ((u16 *)buf)[i] = r4w();
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 136 w2(4);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 137 break;
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 138
10e705f83c3e79 drivers/block/paride/comm.c Takashi Iwai 2006-03-24 139 case 4: w3(0x68); (void)r1(); w2(0x24);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 140 for (i=0;i<count/4;i++) ((u32 *)buf)[i] = r4l();
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 141 w2(4);
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 142 break;
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 143
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 144 }
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 145 }
^1da177e4c3f41 drivers/block/paride/comm.c Linus Torvalds 2005-04-16 146

:::::: The code at line 135 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki