Re: [PATCH v8 2/3] net/9p/usbg: Add new usb gadget function transport

From: kernel test robot
Date: Sun Jul 21 2024 - 22:11:12 EST


Hi Michael,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 2c9b3512402ed192d1f43f4531fb5da947e72bd0]

url: https://github.com/intel-lab-lkp/linux/commits/Michael-Grzeschik/usb-gadget-function-move-u_f-h-to-include-linux-usb-func_utils-h/20240722-070652
base: 2c9b3512402ed192d1f43f4531fb5da947e72bd0
patch link: https://lore.kernel.org/r/20240116-ml-topic-u9p-v8-2-409e659ca4dd%40pengutronix.de
patch subject: [PATCH v8 2/3] net/9p/usbg: Add new usb gadget function transport
config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20240722/202407220933.WQ9L15Zw-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240722/202407220933.WQ9L15Zw-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/202407220933.WQ9L15Zw-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

net/9p/trans_usbg.c: In function 'p9_usbg_create':
>> net/9p/trans_usbg.c:407:35: warning: variable 'cdev' set but not used [-Wunused-but-set-variable]
407 | struct usb_composite_dev *cdev;
| ^~~~


vim +/cdev +407 net/9p/trans_usbg.c

404
405 static int p9_usbg_create(struct p9_client *client, const char *devname, char *args)
406 {
> 407 struct usb_composite_dev *cdev;
408 struct f_usb9pfs_dev *dev;
409 struct f_usb9pfs_dev *tmp;
410 struct f_usb9pfs *usb9pfs;
411 struct usb_function *f;
412 int ret = -ENOENT;
413 int found = 0;
414
415 if (!devname)
416 return -EINVAL;
417
418 mutex_lock(&usb9pfs_lock);
419 list_for_each_entry_safe(dev, tmp, &usbg_instance_list, usb9pfs_instance) {
420 if (!strncmp(devname, dev->tag, strlen(devname))) {
421 if (!dev->inuse) {
422 dev->inuse = true;
423 found = 1;
424 break;
425 }
426 ret = -EBUSY;
427 break;
428 }
429 }
430
431 if (!found) {
432 mutex_unlock(&usb9pfs_lock);
433 pr_err("no channels available for device %s\n", devname);
434 return ret;
435 }
436
437 usb9pfs = dev->usb9pfs;
438 if (!usb9pfs) {
439 mutex_unlock(&usb9pfs_lock);
440 return -EINVAL;
441 }
442
443 INIT_LIST_HEAD(&usb9pfs->tx_req_list);
444
445 f = &usb9pfs->function;
446 cdev = f->config->cdev;
447
448 client->trans = (void *)usb9pfs;
449 if (!usb9pfs->in_req)
450 client->status = Disconnected;
451 else
452 client->status = Connected;
453 usb9pfs->client = client;
454
455 client->trans_mod->maxsize = usb9pfs->buflen;
456
457 mutex_unlock(&usb9pfs_lock);
458
459 return 0;
460 }
461

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