Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'pci/misc'

- Reorganize kerneldoc parameter names to match order in function signature
(Julia Lawall)

- Remove kerneldoc return value descriptions from hotplug registration
interfaces that don't return anything (Ilpo Järvinen)

- Fix sysfs reset_method_store() memory leak (Todd Kjos)

- Simplify pci_create_slot() (Ilpo Järvinen)

- Fix incorrect printf format specifiers in pcitest (Luo Yifan)

* pci/misc:
tools: PCI: Fix incorrect printf format specifiers
PCI: Simplify pci_create_slot() logic
PCI: Fix reset_method_store() memory leak
PCI: hotplug: Remove "Returns" kerneldoc from void functions
PCI: hotplug: Reorganize kerneldoc parameter names

+20 -23
+1 -7
drivers/pci/hotplug/pci_hotplug_core.c
··· 388 388 389 389 /** 390 390 * __pci_hp_register - register a hotplug_slot with the PCI hotplug subsystem 391 - * @bus: bus this slot is on 392 391 * @slot: pointer to the &struct hotplug_slot to register 392 + * @bus: bus this slot is on 393 393 * @devnr: device number 394 394 * @name: name registered with kobject core 395 395 * @owner: caller module owner ··· 498 498 * 499 499 * The @slot must have been registered with the pci hotplug subsystem 500 500 * previously with a call to pci_hp_register(). 501 - * 502 - * Returns 0 if successful, anything else for an error. 503 501 */ 504 502 void pci_hp_deregister(struct hotplug_slot *slot) 505 503 { ··· 511 513 * @slot: pointer to the &struct hotplug_slot to unpublish 512 514 * 513 515 * Remove a hotplug slot's sysfs interface. 514 - * 515 - * Returns 0 on success or a negative int on error. 516 516 */ 517 517 void pci_hp_del(struct hotplug_slot *slot) 518 518 { ··· 541 545 * the driver may no longer invoke hotplug_slot_name() to get the slot's 542 546 * unique name. The driver no longer needs to handle a ->reset_slot callback 543 547 * from this point on. 544 - * 545 - * Returns 0 on success or a negative int on error. 546 548 */ 547 549 void pci_hp_destroy(struct hotplug_slot *slot) 548 550 {
+3 -2
drivers/pci/pci.c
··· 5250 5250 const char *buf, size_t count) 5251 5251 { 5252 5252 struct pci_dev *pdev = to_pci_dev(dev); 5253 - char *options, *name; 5253 + char *options, *tmp_options, *name; 5254 5254 int m, n; 5255 5255 u8 reset_methods[PCI_NUM_RESET_METHODS] = { 0 }; 5256 5256 ··· 5270 5270 return -ENOMEM; 5271 5271 5272 5272 n = 0; 5273 - while ((name = strsep(&options, " ")) != NULL) { 5273 + tmp_options = options; 5274 + while ((name = strsep(&tmp_options, " ")) != NULL) { 5274 5275 if (sysfs_streq(name, "")) 5275 5276 continue; 5276 5277
+11 -9
drivers/pci/slot.c
··· 245 245 slot = get_slot(parent, slot_nr); 246 246 if (slot) { 247 247 if (hotplug) { 248 - if ((err = slot->hotplug ? -EBUSY : 0) 249 - || (err = rename_slot(slot, name))) { 250 - kobject_put(&slot->kobj); 251 - slot = NULL; 252 - goto err; 248 + if (slot->hotplug) { 249 + err = -EBUSY; 250 + goto put_slot; 253 251 } 252 + err = rename_slot(slot, name); 253 + if (err) 254 + goto put_slot; 254 255 } 255 256 goto out; 256 257 } ··· 281 280 282 281 err = kobject_init_and_add(&slot->kobj, &pci_slot_ktype, NULL, 283 282 "%s", slot_name); 284 - if (err) { 285 - kobject_put(&slot->kobj); 286 - goto err; 287 - } 283 + if (err) 284 + goto put_slot; 288 285 289 286 down_read(&pci_bus_sem); 290 287 list_for_each_entry(dev, &parent->devices, bus_list) ··· 297 298 kfree(slot_name); 298 299 mutex_unlock(&pci_slot_mutex); 299 300 return slot; 301 + 302 + put_slot: 303 + kobject_put(&slot->kobj); 300 304 err: 301 305 slot = ERR_PTR(err); 302 306 goto out;
+5 -5
tools/pci/pcitest.c
··· 95 95 96 96 if (test->msinum > 0 && test->msinum <= 32) { 97 97 ret = ioctl(fd, PCITEST_MSI, test->msinum); 98 - fprintf(stdout, "MSI%d:\t\t", test->msinum); 98 + fprintf(stdout, "MSI%u:\t\t", test->msinum); 99 99 if (ret < 0) 100 100 fprintf(stdout, "TEST FAILED\n"); 101 101 else ··· 104 104 105 105 if (test->msixnum > 0 && test->msixnum <= 2048) { 106 106 ret = ioctl(fd, PCITEST_MSIX, test->msixnum); 107 - fprintf(stdout, "MSI-X%d:\t\t", test->msixnum); 107 + fprintf(stdout, "MSI-X%u:\t\t", test->msixnum); 108 108 if (ret < 0) 109 109 fprintf(stdout, "TEST FAILED\n"); 110 110 else ··· 116 116 if (test->use_dma) 117 117 param.flags = PCITEST_FLAGS_USE_DMA; 118 118 ret = ioctl(fd, PCITEST_WRITE, &param); 119 - fprintf(stdout, "WRITE (%7ld bytes):\t\t", test->size); 119 + fprintf(stdout, "WRITE (%7lu bytes):\t\t", test->size); 120 120 if (ret < 0) 121 121 fprintf(stdout, "TEST FAILED\n"); 122 122 else ··· 128 128 if (test->use_dma) 129 129 param.flags = PCITEST_FLAGS_USE_DMA; 130 130 ret = ioctl(fd, PCITEST_READ, &param); 131 - fprintf(stdout, "READ (%7ld bytes):\t\t", test->size); 131 + fprintf(stdout, "READ (%7lu bytes):\t\t", test->size); 132 132 if (ret < 0) 133 133 fprintf(stdout, "TEST FAILED\n"); 134 134 else ··· 140 140 if (test->use_dma) 141 141 param.flags = PCITEST_FLAGS_USE_DMA; 142 142 ret = ioctl(fd, PCITEST_COPY, &param); 143 - fprintf(stdout, "COPY (%7ld bytes):\t\t", test->size); 143 + fprintf(stdout, "COPY (%7lu bytes):\t\t", test->size); 144 144 if (ret < 0) 145 145 fprintf(stdout, "TEST FAILED\n"); 146 146 else