Skip to content

Commit 9fc9eea

Browse files
committed
PCI: Warn about failures instead of "must_check" functions
These places capture return values to avoid "must_check" warnings, but we didn't *do* anything with the return values, which causes "set but not used" warnings. We might as well do something instead of just trying to evade the "must_check" warnings. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent d67aed6 commit 9fc9eea

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎drivers/pci/bus.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ void pci_bus_add_devices(const struct pci_bus *bus)
202202
if (dev->is_added)
203203
continue;
204204
retval = pci_bus_add_device(dev);
205+
if (retval)
206+
dev_err(&dev->dev, "Error adding device (%d)\n",
207+
retval);
205208
}
206209

207210
list_for_each_entry(dev, &bus->devices, bus_list) {

‎drivers/pci/setup-bus.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,8 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
15451545

15461546
enable_all:
15471547
retval = pci_reenable_device(bridge);
1548+
if (retval)
1549+
dev_err(&bridge->dev, "Error reenabling bridge (%d)\n", retval);
15481550
pci_set_master(bridge);
15491551
pci_enable_bridges(parent);
15501552
}

‎drivers/pci/slot.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,17 @@ void pci_hp_create_module_link(struct pci_slot *pci_slot)
377377
{
378378
struct hotplug_slot *slot = pci_slot->hotplug;
379379
struct kobject *kobj = NULL;
380-
int no_warn;
380+
int ret;
381381

382382
if (!slot || !slot->ops)
383383
return;
384384
kobj = kset_find_obj(module_kset, slot->ops->mod_name);
385385
if (!kobj)
386386
return;
387-
no_warn = sysfs_create_link(&pci_slot->kobj, kobj, "module");
387+
ret = sysfs_create_link(&pci_slot->kobj, kobj, "module");
388+
if (ret)
389+
dev_err(&pci_slot->bus->dev, "Error creating sysfs link (%d)\n",
390+
ret);
388391
kobject_put(kobj);
389392
}
390393
EXPORT_SYMBOL_GPL(pci_hp_create_module_link);

0 commit comments

Comments
 (0)