
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: d96cd567c8d8d584405abe92c2576bf58202fa6e commit: 45db33709ccc7330c55fc6751c96468de407f2ac [1605/1605] PCI: Allow specifying devices using a base bus and path of devfns config: x86_64-buildonly-randconfig-2001-20250501 (https://download.01.org/0day-ci/archive/20250703/202507030025.FLRGGgYy-lkp@i...) compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250703/202507030025.FLRGGgYy-lkp@i...) 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@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202507030025.FLRGGgYy-lkp@intel.com/ All warnings (new ones prefixed by >>):
drivers/pci/pci.c:215: warning: Function parameter or member 'path' not described in 'pci_dev_str_match_path' drivers/pci/pci.c:215: warning: Excess function parameter 'p' description in 'pci_dev_str_match_path'
vim +215 drivers/pci/pci.c 193 194 /** 195 * pci_dev_str_match_path - test if a path string matches a device 196 * @dev: the PCI device to test 197 * @p: string to match the device against 198 * @endptr: pointer to the string after the match 199 * 200 * Test if a string (typically from a kernel parameter) formatted as a 201 * path of device/function addresses matches a PCI device. The string must 202 * be of the form: 203 * 204 * [<domain>:]<bus>:<device>.<func>[/<device>.<func>]* 205 * 206 * A path for a device can be obtained using 'lspci -t'. Using a path 207 * is more robust against bus renumbering than using only a single bus, 208 * device and function address. 209 * 210 * Returns 1 if the string matches the device, 0 if it does not and 211 * a negative error code if it fails to parse the string. 212 */ 213 static int pci_dev_str_match_path(struct pci_dev *dev, const char *path, 214 const char **endptr)
215 { 216 int ret; 217 int seg, bus, slot, func; 218 char *wpath, *p; 219 char end; 220 221 *endptr = strchrnul(path, ';'); 222 223 wpath = kmemdup_nul(path, *endptr - path, GFP_KERNEL); 224 if (!wpath) 225 return -ENOMEM; 226 227 while (1) { 228 p = strrchr(wpath, '/'); 229 if (!p) 230 break; 231 ret = sscanf(p, "/%x.%x%c", &slot, &func, &end); 232 if (ret != 2) { 233 ret = -EINVAL; 234 goto free_and_exit; 235 } 236 237 if (dev->devfn != PCI_DEVFN(slot, func)) { 238 ret = 0; 239 goto free_and_exit; 240 } 241 242 /* 243 * Note: we don't need to get a reference to the upstream 244 * bridge because we hold a reference to the top level 245 * device which should hold a reference to the bridge, 246 * and so on. 247 */ 248 dev = pci_upstream_bridge(dev); 249 if (!dev) { 250 ret = 0; 251 goto free_and_exit; 252 } 253 254 *p = 0; 255 } 256 257 ret = sscanf(wpath, "%x:%x:%x.%x%c", &seg, &bus, &slot, 258 &func, &end); 259 if (ret != 4) { 260 seg = 0; 261 ret = sscanf(wpath, "%x:%x.%x%c", &bus, &slot, &func, &end); 262 if (ret != 3) { 263 ret = -EINVAL; 264 goto free_and_exit; 265 } 266 } 267 268 ret = (seg == pci_domain_nr(dev->bus) && 269 bus == dev->bus->number && 270 dev->devfn == PCI_DEVFN(slot, func)); 271 272 free_and_exit: 273 kfree(wpath); 274 return ret; 275 } 276
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki