[usb:usb-testing 66/66] drivers/usb/gadget/function/u_audio.c:589:45: error: variable 'p_pktsize_residue' set but not used
From: kernel test robot <hidden>
Date: 2021-10-11 18:48:47
Also in:
oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing head: d143d2c76ed6b02cca4a366cb1ed8549c5fc2a32 commit: d143d2c76ed6b02cca4a366cb1ed8549c5fc2a32 [66/66] usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback config: nios2-allyesconfig (attached as .config) compiler: nios2-linux-gcc (GCC) 11.2.0 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 # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?id=d143d2c76ed6b02cca4a366cb1ed8549c5fc2a32 git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git git fetch --no-tags usb usb-testing git checkout d143d2c76ed6b02cca4a366cb1ed8549c5fc2a32 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nios2 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <redacted> All errors (new ones prefixed by >>): drivers/usb/gadget/function/u_audio.c: In function 'u_audio_start_playback':
quoted
drivers/usb/gadget/function/u_audio.c:589:45: error: variable 'p_pktsize_residue' set but not used [-Werror=unused-but-set-variable]
589 | unsigned int p_interval, p_pktsize, p_pktsize_residue;
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/p_pktsize_residue +589 drivers/usb/gadget/function/u_audio.c
576
577 int u_audio_start_playback(struct g_audio *audio_dev)
578 {
579 struct snd_uac_chip *uac = audio_dev->uac;
580 struct usb_gadget *gadget = audio_dev->gadget;
581 struct device *dev = &gadget->dev;
582 struct usb_request *req;
583 struct usb_ep *ep;
584 struct uac_rtd_params *prm;
585 struct uac_params *params = &audio_dev->params;
586 unsigned int factor;
587 const struct usb_endpoint_descriptor *ep_desc;
588 int req_len, i;
> 589 unsigned int p_interval, p_pktsize, p_pktsize_residue;
590
591 ep = audio_dev->in_ep;
592 prm = &uac->p_prm;
593 config_ep_by_speed(gadget, &audio_dev->func, ep);
594
595 ep_desc = ep->desc;
596 /*
597 * Always start with original frequency
598 */
599 prm->pitch = 1000000;
600
601 /* pre-calculate the playback endpoint's interval */
602 if (gadget->speed == USB_SPEED_FULL)
603 factor = 1000;
604 else
605 factor = 8000;
606
607 /* pre-compute some values for iso_complete() */
608 uac->p_framesize = params->p_ssize *
609 num_channels(params->p_chmask);
610 p_interval = factor / (1 << (ep_desc->bInterval - 1));
611 uac->p_interval_mil = (unsigned long long) p_interval * 1000000;
612 p_pktsize = min_t(unsigned int,
613 uac->p_framesize *
614 (params->p_srate / p_interval),
615 ep->maxpacket);
616
617 if (p_pktsize < ep->maxpacket)
618 p_pktsize_residue = uac->p_framesize *
619 (params->p_srate % p_interval);
620 else
621 p_pktsize_residue = 0;
622
623 req_len = p_pktsize;
624 uac->p_residue_mil = 0;
625
626 prm->ep_enabled = true;
627 usb_ep_enable(ep);
628
629 for (i = 0; i < params->req_number; i++) {
630 if (!prm->reqs[i]) {
631 req = usb_ep_alloc_request(ep, GFP_ATOMIC);
632 if (req == NULL)
633 return -ENOMEM;
634
635 prm->reqs[i] = req;
636
637 req->zero = 0;
638 req->context = prm;
639 req->length = req_len;
640 req->complete = u_audio_iso_complete;
641 req->buf = prm->rbuf + i * ep->maxpacket;
642 }
643
644 if (usb_ep_queue(ep, prm->reqs[i], GFP_ATOMIC))
645 dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
646 }
647
648 return 0;
649 }
650 EXPORT_SYMBOL_GPL(u_audio_start_playback);
651
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Attachments
- .config.gz [application/gzip] 61049 bytes