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

PCI: Remove unused variables

This fixes "set but not used" warnings found via "make W=1".

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

+5 -16
-2
drivers/pci/hotplug/pci_hotplug_core.c
··· 520 520 int __must_check pci_hp_change_slot_info(struct hotplug_slot *hotplug, 521 521 struct hotplug_slot_info *info) 522 522 { 523 - struct pci_slot *slot; 524 523 if (!hotplug || !info) 525 524 return -ENODEV; 526 - slot = hotplug->pci_slot; 527 525 528 526 memcpy(hotplug->info, info, sizeof(struct hotplug_slot_info)); 529 527
+5 -12
drivers/pci/pcie/portdrv_pci.c
··· 272 272 enum pci_channel_state error) 273 273 { 274 274 struct aer_broadcast_data data = {error, PCI_ERS_RESULT_CAN_RECOVER}; 275 - int ret; 276 275 277 - /* can not fail */ 278 - ret = device_for_each_child(&dev->dev, &data, error_detected_iter); 279 - 276 + /* get true return value from &data */ 277 + device_for_each_child(&dev->dev, &data, error_detected_iter); 280 278 return data.result; 281 279 } 282 280 ··· 306 308 static pci_ers_result_t pcie_portdrv_mmio_enabled(struct pci_dev *dev) 307 309 { 308 310 pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED; 309 - int retval; 310 311 311 312 /* get true return value from &status */ 312 - retval = device_for_each_child(&dev->dev, &status, mmio_enabled_iter); 313 + device_for_each_child(&dev->dev, &status, mmio_enabled_iter); 313 314 return status; 314 315 } 315 316 ··· 340 343 static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) 341 344 { 342 345 pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED; 343 - int retval; 344 346 345 347 /* If fatal, restore cfg space for possible link reset at upstream */ 346 348 if (dev->error_state == pci_channel_io_frozen) { ··· 350 354 } 351 355 352 356 /* get true return value from &status */ 353 - retval = device_for_each_child(&dev->dev, &status, slot_reset_iter); 354 - 357 + device_for_each_child(&dev->dev, &status, slot_reset_iter); 355 358 return status; 356 359 } 357 360 ··· 376 381 377 382 static void pcie_portdrv_err_resume(struct pci_dev *dev) 378 383 { 379 - int retval; 380 - /* nothing to do with error value, if it ever happens */ 381 - retval = device_for_each_child(&dev->dev, NULL, resume_iter); 384 + device_for_each_child(&dev->dev, NULL, resume_iter); 382 385 } 383 386 384 387 /*
-2
drivers/pci/setup-res.c
··· 261 261 { 262 262 struct resource *res = dev->resource + resno; 263 263 resource_size_t align, size; 264 - struct pci_bus *bus; 265 264 int ret; 266 265 267 266 align = pci_resource_alignment(dev, res); ··· 270 271 return -EINVAL; 271 272 } 272 273 273 - bus = dev->bus; 274 274 size = resource_size(res); 275 275 ret = _pci_assign_resource(dev, resno, size, align); 276 276