CC: kbuild-all(a)lists.01.org In-Reply-To: <20210526100311.56327-2-eli.billauer@gmail.com> References: <20210526100311.56327-2-eli.billauer@gmail.com> TO: eli.billauer(a)gmail.com TO: gregkh(a)linuxfoundation.org TO: arnd(a)arndb.de CC: linux-kernel(a)vger.kernel.org CC: linux-usb(a)vger.kernel.org CC: Eli Billauer Hi, I love your patch! Perhaps something to improve: [auto build test WARNING on char-misc/char-misc-testing] [also build test WARNING on soc/for-next linux/master linus/master v5.13-rc3 next-20210526] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/eli-billauer-gmail-com/Submission-of-XillyUSB-driver/20210526-180607 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 83aacfbcbd42eec3882423bbafcb8b3190376ed8 :::::: branch date: 3 hours ago :::::: commit date: 3 hours ago config: i386-randconfig-c001-20210526 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Julia Lawall cocci warnings: (new ones prefixed by >>) >> drivers/char/xillybus/xillybus_class.c:195:14-18: ERROR: invalid reference to the index variable of the iterator on line 183 drivers/char/xillybus/xillybus_class.c:196:15-19: ERROR: invalid reference to the index variable of the iterator on line 183 drivers/char/xillybus/xillybus_class.c:196:36-40: ERROR: invalid reference to the index variable of the iterator on line 183 drivers/char/xillybus/xillybus_class.c:238:17-21: ERROR: invalid reference to the index variable of the iterator on line 225 vim +195 drivers/char/xillybus/xillybus_class.c 377c6b94ae2a5e9 Eli Billauer 2021-05-26 173 377c6b94ae2a5e9 Eli Billauer 2021-05-26 174 void xillybus_cleanup_chrdev(void *private_data, 377c6b94ae2a5e9 Eli Billauer 2021-05-26 175 struct device *dev) 377c6b94ae2a5e9 Eli Billauer 2021-05-26 176 { 377c6b94ae2a5e9 Eli Billauer 2021-05-26 177 int minor; 377c6b94ae2a5e9 Eli Billauer 2021-05-26 178 struct xilly_unit *unit; 377c6b94ae2a5e9 Eli Billauer 2021-05-26 179 bool found = false; 377c6b94ae2a5e9 Eli Billauer 2021-05-26 180 377c6b94ae2a5e9 Eli Billauer 2021-05-26 181 mutex_lock(&unit_mutex); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 182 377c6b94ae2a5e9 Eli Billauer 2021-05-26 @183 list_for_each_entry(unit, &unit_list, list_entry) 377c6b94ae2a5e9 Eli Billauer 2021-05-26 184 if (unit->private_data == private_data) { 377c6b94ae2a5e9 Eli Billauer 2021-05-26 185 found = true; 377c6b94ae2a5e9 Eli Billauer 2021-05-26 186 break; 377c6b94ae2a5e9 Eli Billauer 2021-05-26 187 } 377c6b94ae2a5e9 Eli Billauer 2021-05-26 188 377c6b94ae2a5e9 Eli Billauer 2021-05-26 189 if (!found) { 377c6b94ae2a5e9 Eli Billauer 2021-05-26 190 dev_err(dev, "Weird bug: Failed to find unit\n"); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 191 mutex_unlock(&unit_mutex); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 192 return; 377c6b94ae2a5e9 Eli Billauer 2021-05-26 193 } 377c6b94ae2a5e9 Eli Billauer 2021-05-26 194 377c6b94ae2a5e9 Eli Billauer 2021-05-26 @195 for (minor = unit->lowest_minor; 377c6b94ae2a5e9 Eli Billauer 2021-05-26 196 minor < (unit->lowest_minor + unit->num_nodes); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 197 minor++) 377c6b94ae2a5e9 Eli Billauer 2021-05-26 198 device_destroy(xillybus_class, MKDEV(unit->major, minor)); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 199 377c6b94ae2a5e9 Eli Billauer 2021-05-26 200 cdev_del(unit->cdev); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 201 377c6b94ae2a5e9 Eli Billauer 2021-05-26 202 unregister_chrdev_region(MKDEV(unit->major, unit->lowest_minor), 377c6b94ae2a5e9 Eli Billauer 2021-05-26 203 unit->num_nodes); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 204 377c6b94ae2a5e9 Eli Billauer 2021-05-26 205 dev_info(dev, "Removed %d device files.\n", 377c6b94ae2a5e9 Eli Billauer 2021-05-26 206 unit->num_nodes); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 207 377c6b94ae2a5e9 Eli Billauer 2021-05-26 208 list_del(&unit->list_entry); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 209 kfree(unit); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 210 377c6b94ae2a5e9 Eli Billauer 2021-05-26 211 mutex_unlock(&unit_mutex); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 212 } 377c6b94ae2a5e9 Eli Billauer 2021-05-26 213 EXPORT_SYMBOL(xillybus_cleanup_chrdev); 377c6b94ae2a5e9 Eli Billauer 2021-05-26 214 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org