drivers/usb/host/xhci.c:1414: warning: Function parameter or member 'desc' not described in 'xhci_get_endpoint_index'

From: kernel test robot
Date: Wed Jan 10 2024 - 05:30:28 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ab27740f76654ed58dd32ac0ba0031c18a6dea3b
commit: 2017a1e58472a27e532b9644b4a61dfe18f6baac usb: xhci: Use temporary buffer to consolidate SG
date: 3 years, 1 month ago
config: x86_64-buildonly-randconfig-006-20240105 (https://download.01.org/0day-ci/archive/20240110/202401101820.I1t9z9cv-lkp@xxxxxxxxx/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240110/202401101820.I1t9z9cv-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/202401101820.I1t9z9cv-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/usb/host/xhci.c:1414: warning: Function parameter or member 'desc' not described in 'xhci_get_endpoint_index'


vim +1414 drivers/usb/host/xhci.c

2017a1e58472a2 drivers/usb/host/xhci.c Tejas Joglekar 2020-12-08 1402
2017a1e58472a2 drivers/usb/host/xhci.c Tejas Joglekar 2020-12-08 1403 /**
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1404 * xhci_get_endpoint_index - Used for passing endpoint bitmasks between the core and
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1405 * HCDs. Find the index for an endpoint given its descriptor. Use the return
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1406 * value to right shift 1 for the bitmask.
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1407 *
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1408 * Index = (epnum * 2) + direction - 1,
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1409 * where direction = 0 for OUT, 1 for IN.
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1410 * For control endpoints, the IN index is used (OUT index is unused), so
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1411 * index = (epnum * 2) + direction - 1 = (epnum * 2) + 1 - 1 = (epnum * 2)
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1412 */
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1413 unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc)
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 @1414 {
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1415 unsigned int index;
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1416 if (usb_endpoint_xfer_control(desc))
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1417 index = (unsigned int) (usb_endpoint_num(desc)*2);
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1418 else
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1419 index = (unsigned int) (usb_endpoint_num(desc)*2) +
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1420 (usb_endpoint_dir_in(desc) ? 1 : 0) - 1;
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1421 return index;
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1422 }
d0e96f5a71a032 drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27 1423

:::::: The code at line 1414 was first introduced by commit
:::::: d0e96f5a71a032ced0c35f521c1cbd67e816922a USB: xhci: Control transfer support.

:::::: TO: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxx>

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