drivers/accessibility/speakup/speakup_dtlk.c:334:28: sparse: sparse: cast to restricted __le16

From: kernel test robot
Date: Thu Oct 29 2020 - 10:03:21 EST


Hi Samuel,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 23859ae44402f4d935b9ee548135dd1e65e2cbf4
commit: 2067fd92d75b6d9085a43caf050bca5d88c491b8 staging/speakup: Move out of staging
date: 3 months ago
config: m68k-randconfig-s031-20201029 (attached as .config)
compiler: m68k-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.3-56-gc09e8239-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2067fd92d75b6d9085a43caf050bca5d88c491b8
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2067fd92d75b6d9085a43caf050bca5d88c491b8
# 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=m68k

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/accessibility/speakup/speakup_dtlk.c:334:28: sparse: sparse: cast to restricted __le16
>> drivers/accessibility/speakup/speakup_dtlk.c:334:28: sparse: sparse: cast to restricted __le16
>> drivers/accessibility/speakup/speakup_dtlk.c:334:28: sparse: sparse: cast to restricted __le16
>> drivers/accessibility/speakup/speakup_dtlk.c:334:28: sparse: sparse: cast to restricted __le16
drivers/accessibility/speakup/speakup_dtlk.c:341:36: sparse: sparse: cast to restricted __le16
drivers/accessibility/speakup/speakup_dtlk.c:341:36: sparse: sparse: cast to restricted __le16
drivers/accessibility/speakup/speakup_dtlk.c:341:36: sparse: sparse: cast to restricted __le16
drivers/accessibility/speakup/speakup_dtlk.c:341:36: sparse: sparse: cast to restricted __le16
drivers/accessibility/speakup/speakup_dtlk.c:358:16: sparse: sparse: cast to restricted __le16
drivers/accessibility/speakup/speakup_dtlk.c:358:16: sparse: sparse: cast to restricted __le16
drivers/accessibility/speakup/speakup_dtlk.c:358:16: sparse: sparse: cast to restricted __le16
drivers/accessibility/speakup/speakup_dtlk.c:358:16: sparse: sparse: cast to restricted __le16
--
>> drivers/accessibility/speakup/serialio.c:139:9: sparse: sparse: incompatible types in conditional expression (different base types):
>> drivers/accessibility/speakup/serialio.c:139:9: sparse: unsigned char
>> drivers/accessibility/speakup/serialio.c:139:9: sparse: void
drivers/accessibility/speakup/serialio.c:142:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:142:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:142:9: sparse: void
drivers/accessibility/speakup/serialio.c:148:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:148:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:148:9: sparse: void
drivers/accessibility/speakup/serialio.c:160:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:160:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:160:9: sparse: void
drivers/accessibility/speakup/serialio.c:167:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:167:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:167:9: sparse: void
drivers/accessibility/speakup/serialio.c:87:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:87:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:87:9: sparse: void
drivers/accessibility/speakup/serialio.c:88:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:88:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:88:9: sparse: void
drivers/accessibility/speakup/serialio.c:89:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:89:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:89:9: sparse: void
drivers/accessibility/speakup/serialio.c:90:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:90:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:90:9: sparse: void
drivers/accessibility/speakup/serialio.c:93:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:93:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:93:9: sparse: void
drivers/accessibility/speakup/serialio.c:94:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:94:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:94:9: sparse: void
drivers/accessibility/speakup/serialio.c:208:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:208:9: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:208:9: sparse: void
drivers/accessibility/speakup/serialio.c:299:25: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/accessibility/speakup/serialio.c:299:25: sparse: unsigned char
drivers/accessibility/speakup/serialio.c:299:25: sparse: void

vim +334 drivers/accessibility/speakup/speakup_dtlk.c

c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 315
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 316 static int synth_probe(struct spk_synth *synth)
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 317 {
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 318 unsigned int port_val = 0;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 319 int i = 0;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 320 struct synth_settings *sp;
8e69a8110686572 drivers/staging/speakup/speakup_dtlk.c Domagoj Trsan 2014-09-09 321
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 322 pr_info("Probing for DoubleTalk.\n");
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 323 if (port_forced) {
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 324 speakup_info.port_tts = port_forced;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 325 pr_info("probe forced to %x by kernel command line\n",
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 326 speakup_info.port_tts);
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 327 if ((port_forced & 0xf) != 0xf)
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 328 pr_info("warning: port base should probably end with f\n");
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 329 if (synth_request_region(speakup_info.port_tts - 1,
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 330 SYNTH_IO_EXTENT)) {
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 331 pr_warn("sorry, port already reserved\n");
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 332 return -EBUSY;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 333 }
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 @334 port_val = inw(speakup_info.port_tts - 1);
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 335 synth_lpc = speakup_info.port_tts - 1;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 336 } else {
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 337 for (i = 0; synth_portlist[i]; i++) {
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 338 if (synth_request_region(synth_portlist[i],
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 339 SYNTH_IO_EXTENT))
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 340 continue;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 341 port_val = inw(synth_portlist[i]) & 0xfbff;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 342 if (port_val == 0x107f) {
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 343 synth_lpc = synth_portlist[i];
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 344 speakup_info.port_tts = synth_lpc + 1;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 345 break;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 346 }
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 347 synth_release_region(synth_portlist[i],
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 348 SYNTH_IO_EXTENT);
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 349 }
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 350 }
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 351 port_val &= 0xfbff;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 352 if (port_val != 0x107f) {
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 353 pr_info("DoubleTalk PC: not found\n");
7aa4d5c8ffed00f drivers/staging/speakup/speakup_dtlk.c Alan Cox 2014-12-15 354 if (synth_lpc)
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 355 synth_release_region(synth_lpc, SYNTH_IO_EXTENT);
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 356 return -ENODEV;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 357 }
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 358 while (inw_p(synth_lpc) != 0x147f)
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 359 cpu_relax(); /* wait until it's ready */
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 360 sp = synth_interrogate(synth);
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 361 pr_info("%s: %03x-%03x, ROM ver %s, s/n %u, driver: %s\n",
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 362 synth->long_name, synth_lpc, synth_lpc + SYNTH_IO_EXTENT - 1,
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 363 sp->rom_version, sp->serial_number, synth->version);
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 364 synth->alive = 1;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 365 return 0;
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 366 }
c6e3fd22cd53836 drivers/staging/speakup/speakup_dtlk.c William Hubbs 2010-10-07 367

:::::: The code at line 334 was first introduced by commit
:::::: c6e3fd22cd538365bfeb82997d5b89562e077d42 Staging: add speakup to the staging directory

:::::: TO: William Hubbs <w.d.hubbs@xxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxx>

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

Attachment: .config.gz
Description: application/gzip