* [balbi-usb:testing/next 104/108] drivers/usb/cdns3/gadget.c:509:7: warning: variable 'length' set but not used
@ 2020-09-29 7:41 kernel test robot
2020-09-29 8:31 ` Peter Chen
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-09-29 7:41 UTC (permalink / raw)
To: Peter Chen; +Cc: kbuild-all, linux-usb, linux-omap, Felipe Balbi
[-- Attachment #1: Type: text/plain, Size: 4770 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next
head: 9c732b42aa881424b2b918e0f08f1c6f017061d3
commit: f12b2ec1c423979210a70e0e76933d7d5adf22b0 [104/108] usb: cdns3: gadget: need to handle sg case for workaround 2 case
config: openrisc-allmodconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.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/balbi/usb.git/commit/?id=f12b2ec1c423979210a70e0e76933d7d5adf22b0
git remote add balbi-usb https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
git fetch --no-tags balbi-usb testing/next
git checkout f12b2ec1c423979210a70e0e76933d7d5adf22b0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/usb/cdns3/gadget.c: In function 'cdns3_wa2_descmiss_copy_data':
>> drivers/usb/cdns3/gadget.c:509:7: warning: variable 'length' set but not used [-Wunused-but-set-variable]
509 | int length;
| ^~~~~~
vim +/length +509 drivers/usb/cdns3/gadget.c
f12b2ec1c423979 Peter Chen 2020-09-10 494
6bbf87a131edd39 Pawel Laszczak 2019-08-26 495 /**
6bbf87a131edd39 Pawel Laszczak 2019-08-26 496 * cdns3_wa2_descmiss_copy_data copy data from internal requests to
6bbf87a131edd39 Pawel Laszczak 2019-08-26 497 * request queued by class driver.
6bbf87a131edd39 Pawel Laszczak 2019-08-26 498 * @priv_ep: extended endpoint object
6bbf87a131edd39 Pawel Laszczak 2019-08-26 499 * @request: request object
6bbf87a131edd39 Pawel Laszczak 2019-08-26 500 */
6bbf87a131edd39 Pawel Laszczak 2019-08-26 501 static void cdns3_wa2_descmiss_copy_data(struct cdns3_endpoint *priv_ep,
6bbf87a131edd39 Pawel Laszczak 2019-08-26 502 struct usb_request *request)
6bbf87a131edd39 Pawel Laszczak 2019-08-26 503 {
6bbf87a131edd39 Pawel Laszczak 2019-08-26 504 struct usb_request *descmiss_req;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 505 struct cdns3_request *descmiss_priv_req;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 506
6bbf87a131edd39 Pawel Laszczak 2019-08-26 507 while (!list_empty(&priv_ep->wa2_descmiss_req_list)) {
6bbf87a131edd39 Pawel Laszczak 2019-08-26 508 int chunk_end;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 @509 int length;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 510
6bbf87a131edd39 Pawel Laszczak 2019-08-26 511 descmiss_priv_req =
6bbf87a131edd39 Pawel Laszczak 2019-08-26 512 cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list);
6bbf87a131edd39 Pawel Laszczak 2019-08-26 513 descmiss_req = &descmiss_priv_req->request;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 514
6bbf87a131edd39 Pawel Laszczak 2019-08-26 515 /* driver can't touch pending request */
6bbf87a131edd39 Pawel Laszczak 2019-08-26 516 if (descmiss_priv_req->flags & REQUEST_PENDING)
6bbf87a131edd39 Pawel Laszczak 2019-08-26 517 break;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 518
6bbf87a131edd39 Pawel Laszczak 2019-08-26 519 chunk_end = descmiss_priv_req->flags & REQUEST_INTERNAL_CH;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 520 length = request->actual + descmiss_req->actual;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 521 request->status = descmiss_req->status;
f12b2ec1c423979 Peter Chen 2020-09-10 522 __cdns3_descmiss_copy_data(request, descmiss_req);
6bbf87a131edd39 Pawel Laszczak 2019-08-26 523 list_del_init(&descmiss_priv_req->list);
6bbf87a131edd39 Pawel Laszczak 2019-08-26 524 kfree(descmiss_req->buf);
6bbf87a131edd39 Pawel Laszczak 2019-08-26 525 cdns3_gadget_ep_free_request(&priv_ep->endpoint, descmiss_req);
6bbf87a131edd39 Pawel Laszczak 2019-08-26 526 --priv_ep->wa2_counter;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 527
6bbf87a131edd39 Pawel Laszczak 2019-08-26 528 if (!chunk_end)
6bbf87a131edd39 Pawel Laszczak 2019-08-26 529 break;
6bbf87a131edd39 Pawel Laszczak 2019-08-26 530 }
6bbf87a131edd39 Pawel Laszczak 2019-08-26 531 }
6bbf87a131edd39 Pawel Laszczak 2019-08-26 532
:::::: The code at line 509 was first introduced by commit
:::::: 6bbf87a131edd39040974f3843ff97e89310ebde usb:cdns3 Fix for stuck packets in on-chip OUT buffer.
:::::: TO: Pawel Laszczak <pawell@cadence.com>
:::::: CC: Felipe Balbi <felipe.balbi@linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 57282 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [balbi-usb:testing/next 104/108] drivers/usb/cdns3/gadget.c:509:7: warning: variable 'length' set but not used
2020-09-29 7:41 [balbi-usb:testing/next 104/108] drivers/usb/cdns3/gadget.c:509:7: warning: variable 'length' set but not used kernel test robot
@ 2020-09-29 8:31 ` Peter Chen
0 siblings, 0 replies; 2+ messages in thread
From: Peter Chen @ 2020-09-29 8:31 UTC (permalink / raw)
To: kernel test robot; +Cc: kbuild-all, linux-usb, linux-omap, Felipe Balbi
On 20-09-29 15:41:14, kernel test robot wrote:
> All warnings (new ones prefixed by >>):
>
> drivers/usb/cdns3/gadget.c: In function 'cdns3_wa2_descmiss_copy_data':
> >> drivers/usb/cdns3/gadget.c:509:7: warning: variable 'length' set but not used [-Wunused-but-set-variable]
> 509 | int length;
> | ^~~~~~
>
> vim +/length +509 drivers/usb/cdns3/gadget.c
>
> f12b2ec1c423979 Peter Chen 2020-09-10 494
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 495 /**
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 496 * cdns3_wa2_descmiss_copy_data copy data from internal requests to
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 497 * request queued by class driver.
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 498 * @priv_ep: extended endpoint object
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 499 * @request: request object
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 500 */
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 501 static void cdns3_wa2_descmiss_copy_data(struct cdns3_endpoint *priv_ep,
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 502 struct usb_request *request)
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 503 {
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 504 struct usb_request *descmiss_req;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 505 struct cdns3_request *descmiss_priv_req;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 506
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 507 while (!list_empty(&priv_ep->wa2_descmiss_req_list)) {
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 508 int chunk_end;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 @509 int length;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 510
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 511 descmiss_priv_req =
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 512 cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list);
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 513 descmiss_req = &descmiss_priv_req->request;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 514
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 515 /* driver can't touch pending request */
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 516 if (descmiss_priv_req->flags & REQUEST_PENDING)
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 517 break;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 518
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 519 chunk_end = descmiss_priv_req->flags & REQUEST_INTERNAL_CH;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 520 length = request->actual + descmiss_req->actual;
The "length" is used here.
This logic is existed one year ago, and not introduced during recent
patches.
Peter
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 521 request->status = descmiss_req->status;
> f12b2ec1c423979 Peter Chen 2020-09-10 522 __cdns3_descmiss_copy_data(request, descmiss_req);
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 523 list_del_init(&descmiss_priv_req->list);
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 524 kfree(descmiss_req->buf);
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 525 cdns3_gadget_ep_free_request(&priv_ep->endpoint, descmiss_req);
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 526 --priv_ep->wa2_counter;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 527
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 528 if (!chunk_end)
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 529 break;
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 530 }
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 531 }
> 6bbf87a131edd39 Pawel Laszczak 2019-08-26 532
>
> :::::: The code at line 509 was first introduced by commit
> :::::: 6bbf87a131edd39040974f3843ff97e89310ebde usb:cdns3 Fix for stuck packets in on-chip OUT buffer.
>
> :::::: TO: Pawel Laszczak <pawell@cadence.com>
> :::::: CC: Felipe Balbi <felipe.balbi@linux.intel.com>
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fhyperkitty%2Flist%2Fkbuild-all%40lists.01.org&data=02%7C01%7Cpeter.chen%40nxp.com%7Ceb44b3a98d6249fb88f808d8644b2c46%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637369624019300389&sdata=0Nz5ERcQp2BxO5q7uuiIjW3O8Sw6pbyDw1Q9QsqG5Fg%3D&reserved=0
--
Thanks,
Peter Chen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-29 10:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 7:41 [balbi-usb:testing/next 104/108] drivers/usb/cdns3/gadget.c:509:7: warning: variable 'length' set but not used kernel test robot
2020-09-29 8:31 ` Peter Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).