Skip to content

Commit

Permalink
PCI: Warn about failures instead of "must_check" functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bjorn Helgaas committed Apr 17, 2013
1 parent d67aed6 commit 9fc9eea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions drivers/pci/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ void pci_bus_add_devices(const struct pci_bus *bus)
if (dev->is_added)
continue;
retval = pci_bus_add_device(dev);
if (retval)
dev_err(&dev->dev, "Error adding device (%d)\n",
retval);
}

list_for_each_entry(dev, &bus->devices, bus_list) {
Expand Down
2 changes: 2 additions & 0 deletions drivers/pci/setup-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,8 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)

enable_all:
retval = pci_reenable_device(bridge);
if (retval)
dev_err(&bridge->dev, "Error reenabling bridge (%d)\n", retval);
pci_set_master(bridge);
pci_enable_bridges(parent);
}
Expand Down
7 changes: 5 additions & 2 deletions drivers/pci/slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,17 @@ void pci_hp_create_module_link(struct pci_slot *pci_slot)
{
struct hotplug_slot *slot = pci_slot->hotplug;
struct kobject *kobj = NULL;
int no_warn;
int ret;

if (!slot || !slot->ops)
return;
kobj = kset_find_obj(module_kset, slot->ops->mod_name);
if (!kobj)
return;
no_warn = sysfs_create_link(&pci_slot->kobj, kobj, "module");
ret = sysfs_create_link(&pci_slot->kobj, kobj, "module");
if (ret)
dev_err(&pci_slot->bus->dev, "Error creating sysfs link (%d)\n",
ret);
kobject_put(kobj);
}
EXPORT_SYMBOL_GPL(pci_hp_create_module_link);
Expand Down

0 comments on commit 9fc9eea

Please sign in to comment.