CC: llvm(a)lists.linux.dev CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com In-Reply-To: References: TO: Charlie Sands TO: gregkh(a)linuxfoundation.org CC: linux-staging(a)lists.linux.dev CC: linux-kernel(a)vger.kernel.org Hi Charlie, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on staging/staging-testing] url: https://github.com/0day-ci/linux/commits/Charlie-Sands/staging-rts5208-Resolve-checkpath-pl-issues/20220315-102944 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 56955aae9fc2c59fa3c9b32f1f147cdbe05e5ac4 :::::: branch date: 22 hours ago :::::: commit date: 22 hours ago config: riscv-randconfig-c006-20220313 (https://download.01.org/0day-ci/archive/20220316/202203160807.K3AjX7FR-lkp(a)intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a6b2f50fb47da3baeee10b1906da6e30ac5d26ec) 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 riscv cross compiling tool for clang build # apt-get install binutils-riscv64-linux-gnu # https://github.com/0day-ci/linux/commit/db68d91d62af3bfc71979b5fd01ca858a56a22ba git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Charlie-Sands/staging-rts5208-Resolve-checkpath-pl-issues/20220315-102944 git checkout db68d91d62af3bfc71979b5fd01ca858a56a22ba # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot clang-analyzer warnings: (new ones prefixed by >>) Suppressed 10 warnings (3 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (2 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 10 warnings generated. drivers/md/dm-kcopyd.c:246:10: warning: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'pl') [clang-analyzer-core.NullDereference] next = pl->next; ^ drivers/md/dm-kcopyd.c:913:6: note: Assuming 'kc' is non-null if (!kc) ^~~ drivers/md/dm-kcopyd.c:913:2: note: Taking false branch if (!kc) ^ drivers/md/dm-kcopyd.c:916:2: note: Loop condition is false. Exiting loop spin_lock_init(&kc->job_lock); ^ include/linux/spinlock.h:329:35: note: expanded from macro 'spin_lock_init' # define spin_lock_init(lock) \ ^ drivers/md/dm-kcopyd.c:924:6: note: Assuming 'r' is 0 if (r) ^ drivers/md/dm-kcopyd.c:924:2: note: Taking false branch if (r) ^ drivers/md/dm-kcopyd.c:927:2: note: Loop condition is false. Exiting loop INIT_WORK(&kc->kcopyd_work, do_work); ^ include/linux/workqueue.h:245:2: note: expanded from macro 'INIT_WORK' __INIT_WORK((_work), (_func), 0) ^ include/linux/workqueue.h:225:2: note: expanded from macro '__INIT_WORK' do { \ ^ drivers/md/dm-kcopyd.c:929:6: note: Assuming field 'kcopyd_wq' is non-null if (!kc->kcopyd_wq) { ^~~~~~~~~~~~~~ drivers/md/dm-kcopyd.c:929:2: note: Taking false branch if (!kc->kcopyd_wq) { ^ drivers/md/dm-kcopyd.c:939:6: note: Calling 'client_reserve_pages' r = client_reserve_pages(kc, reserve_pages); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/md/dm-kcopyd.c:309:20: note: 'pl' initialized to a null pointer value struct page_list *pl = NULL, *next; ^~ drivers/md/dm-kcopyd.c:311:14: note: Assuming 'i' is >= 'nr_pages' for (i = 0; i < nr_pages; i++) { ^~~~~~~~~~~~ drivers/md/dm-kcopyd.c:311:2: note: Loop condition is false. Execution continues on line 322 for (i = 0; i < nr_pages; i++) { ^ drivers/md/dm-kcopyd.c:323:23: note: Passing null pointer value via 2nd parameter 'pl' kcopyd_put_pages(kc, pl); ^~ drivers/md/dm-kcopyd.c:323:2: note: Calling 'kcopyd_put_pages' kcopyd_put_pages(kc, pl); ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/md/dm-kcopyd.c:246:10: note: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'pl') next = pl->next; ^~ Suppressed 9 warnings (2 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (2 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (2 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (2 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (2 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (2 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 12 warnings generated. drivers/staging/greybus/uart.c:273:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = kfifo_out(&gb_tty->write_fifo, &request->data[0], ^ drivers/staging/greybus/uart.c:273:3: note: Value stored to 'ret' is never read drivers/staging/greybus/uart.c:571:3: warning: Value stored to 'retval' is never read [clang-analyzer-deadcode.DeadStores] retval = send_control(gb_tty, gb_tty->ctrlout); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/greybus/uart.c:571:3: note: Value stored to 'retval' is never read retval = send_control(gb_tty, gb_tty->ctrlout); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/greybus/uart.c:590:3: warning: Value stored to 'retval' is never read [clang-analyzer-deadcode.DeadStores] retval = send_control(gb_tty, gb_tty->ctrlout); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/greybus/uart.c:590:3: note: Value stored to 'retval' is never read retval = send_control(gb_tty, gb_tty->ctrlout); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 9 warnings (2 in non-user code, 7 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 12 warnings generated. >> drivers/staging/rts5208/rtsx.c:187:19: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct rtsx_dev *dev = host_to_rtsx(srb->device->host); ^~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/rts5208/rtsx.c:187:19: note: Value stored to 'dev' during its initialization is never read struct rtsx_dev *dev = host_to_rtsx(srb->device->host); ^~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/rts5208/rtsx.c:384:7: warning: Access to field 'sc_data_direction' results in a dereference of a null pointer (loaded from field 'srb') [clang-analyzer-core.NullDereference] if (chip->srb->sc_data_direction == DMA_BIDIRECTIONAL) { ^ ~~~ drivers/staging/rts5208/rtsx.c:356:2: note: Loop condition is true. Entering loop body for (;;) { ^ drivers/staging/rts5208/rtsx.c:357:7: note: Assuming the condition is false if (wait_for_completion_interruptible(&dev->cmnd_ready)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/rts5208/rtsx.c:357:3: note: Taking false branch if (wait_for_completion_interruptible(&dev->cmnd_ready)) ^ drivers/staging/rts5208/rtsx.c:364:7: note: Assuming field 'rtsx_stat' is not equal to RTSX_STAT_DISCONNECT if (rtsx_chk_stat(chip, RTSX_STAT_DISCONNECT)) { ^ drivers/staging/rts5208/rtsx_chip.h:935:36: note: expanded from macro 'rtsx_chk_stat' #define rtsx_chk_stat(chip, stat) ((chip)->rtsx_stat == (stat)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/rts5208/rtsx.c:364:3: note: Taking false branch if (rtsx_chk_stat(chip, RTSX_STAT_DISCONNECT)) { ^ drivers/staging/rts5208/rtsx.c:374:7: note: Assuming field 'rtsx_stat' is equal to RTSX_STAT_ABORT if (rtsx_chk_stat(chip, RTSX_STAT_ABORT)) { ^ drivers/staging/rts5208/rtsx_chip.h:935:36: note: expanded from macro 'rtsx_chk_stat' #define rtsx_chk_stat(chip, stat) ((chip)->rtsx_stat == (stat)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/rts5208/rtsx.c:374:3: note: Taking true branch if (rtsx_chk_stat(chip, RTSX_STAT_ABORT)) { ^ drivers/staging/rts5208/rtsx.c:376:4: note: Control jumps to line 424 goto skip_for_abort; ^ drivers/staging/rts5208/rtsx.c:424:4: note: Loop condition is false. Exiting loop dev_err(&dev->pci->dev, "scsi command aborted\n"); ^ include/linux/dev_printk.h:144:2: note: expanded from macro 'dev_err' dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) ^ include/linux/dev_printk.h:109:3: note: expanded from macro 'dev_printk_index_wrap' dev_printk_index_emit(level, fmt); \ ^ include/linux/dev_printk.h:105:2: note: expanded from macro 'dev_printk_index_emit' printk_index_subsys_emit("%s %s: ", level, fmt) ^ include/linux/printk.h:413:2: note: expanded from macro 'printk_index_subsys_emit' __printk_index_emit(fmt, level, subsys_fmt_prefix) ^ include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit' #define __printk_index_emit(...) do {} while (0) ^ drivers/staging/rts5208/rtsx.c:427:7: note: Field 'rtsx_stat' is equal to RTSX_STAT_ABORT if (rtsx_chk_stat(chip, RTSX_STAT_ABORT)) { ^ drivers/staging/rts5208/rtsx_chip.h:935:44: note: expanded from macro 'rtsx_chk_stat' #define rtsx_chk_stat(chip, stat) ((chip)->rtsx_stat == (stat)) ^ drivers/staging/rts5208/rtsx.c:427:3: note: Taking true branch if (rtsx_chk_stat(chip, RTSX_STAT_ABORT)) { ^ drivers/staging/rts5208/rtsx.c:430:4: note: RTSX_STAT_IDLE is equal to RTSX_STAT_IDLE rtsx_set_stat(chip, RTSX_STAT_IDLE); ^ drivers/staging/rts5208/rtsx_chip.h:929:6: note: expanded from macro 'rtsx_set_stat' if ((stat) != RTSX_STAT_IDLE) { \ ^~~~~~ drivers/staging/rts5208/rtsx.c:430:4: note: Taking false branch rtsx_set_stat(chip, RTSX_STAT_IDLE); ^ drivers/staging/rts5208/rtsx_chip.h:929:2: note: expanded from macro 'rtsx_set_stat' if ((stat) != RTSX_STAT_IDLE) { \ ^ drivers/staging/rts5208/rtsx.c:430:4: note: Loop condition is false. Exiting loop rtsx_set_stat(chip, RTSX_STAT_IDLE); ^ drivers/staging/rts5208/rtsx_chip.h:927:38: note: expanded from macro 'rtsx_set_stat' #define rtsx_set_stat(chip, stat) \ ^ drivers/staging/rts5208/rtsx.c:434:3: note: Null pointer value stored to field 'srb' chip->srb = NULL; ^~~~~~~~~~~~~~~~ drivers/staging/rts5208/rtsx.c:356:2: note: Loop condition is true. Entering loop body for (;;) { ^ drivers/staging/rts5208/rtsx.c:357:7: note: Assuming the condition is false if (wait_for_completion_interruptible(&dev->cmnd_ready)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/rts5208/rtsx.c:357:3: note: Taking false branch if (wait_for_completion_interruptible(&dev->cmnd_ready)) ^ drivers/staging/rts5208/rtsx.c:364:7: note: Field 'rtsx_stat' is not equal to RTSX_STAT_DISCONNECT if (rtsx_chk_stat(chip, RTSX_STAT_DISCONNECT)) { ^ drivers/staging/rts5208/rtsx_chip.h:935:44: note: expanded from macro 'rtsx_chk_stat' #define rtsx_chk_stat(chip, stat) ((chip)->rtsx_stat == (stat)) vim +/dev +187 drivers/staging/rts5208/rtsx.c fa590c222fbaa4 Micky Ching 2013-11-12 180 228fc259045878 MingChia Chung 2016-08-28 181 /* 228fc259045878 MingChia Chung 2016-08-28 182 * This invokes the transport reset mechanism to reset the state of the 228fc259045878 MingChia Chung 2016-08-28 183 * device 228fc259045878 MingChia Chung 2016-08-28 184 */ fa590c222fbaa4 Micky Ching 2013-11-12 185 static int device_reset(struct scsi_cmnd *srb) fa590c222fbaa4 Micky Ching 2013-11-12 186 { fa590c222fbaa4 Micky Ching 2013-11-12 @187 struct rtsx_dev *dev = host_to_rtsx(srb->device->host); fa590c222fbaa4 Micky Ching 2013-11-12 188 de9a009b934a14 Colin Ian King 2017-02-02 189 return SUCCESS; fa590c222fbaa4 Micky Ching 2013-11-12 190 } fa590c222fbaa4 Micky Ching 2013-11-12 191 --- 0-DAY CI Kernel Test Service https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org