Commit cfbd83d0 authored by Krzysztof Wilczynski's avatar Krzysztof Wilczynski Committed by Bjorn Helgaas
Browse files

PCI: shpchp: Make shpchp_unconfigure_device() void

shpchp_unconfigure_device() always returned 0, so there's no reason for a
return value.  In addition, remove_board() checked the return value for
possible error which is unnecessary.

Convert shpchp_unconfigure_device() to a void function and remove the
return value check.  This addresses the following Coccinelle warning:

  drivers/pci/hotplug/shpchp_pci.c:66:5-7: Unneeded variable: "rc".  Return "0" on line 86

Link: https://lore.kernel.org/r/20200521190457.1066600-1-kw@linux.com


Signed-off-by: default avatarKrzysztof Wilczynski <kw@linux.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent adc9fbcd
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -164,7 +164,7 @@ u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl);
u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl);
u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl);
u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl);
u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl);
int shpchp_configure_device(struct slot *p_slot);
int shpchp_configure_device(struct slot *p_slot);
int shpchp_unconfigure_device(struct slot *p_slot);
void shpchp_unconfigure_device(struct slot *p_slot);
void cleanup_slots(struct controller *ctrl);
void cleanup_slots(struct controller *ctrl);
void shpchp_queue_pushbutton_work(struct work_struct *work);
void shpchp_queue_pushbutton_work(struct work_struct *work);
int shpc_init(struct controller *ctrl, struct pci_dev *pdev);
int shpc_init(struct controller *ctrl, struct pci_dev *pdev);
+1 −2
Original line number Original line Diff line number Diff line
@@ -341,8 +341,7 @@ static int remove_board(struct slot *p_slot)
	u8 hp_slot;
	u8 hp_slot;
	int rc;
	int rc;


	if (shpchp_unconfigure_device(p_slot))
	shpchp_unconfigure_device(p_slot);
		return(1);


	hp_slot = p_slot->device - ctrl->slot_device_offset;
	hp_slot = p_slot->device - ctrl->slot_device_offset;
	p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
	p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
+1 −4
Original line number Original line Diff line number Diff line
@@ -61,9 +61,8 @@ int shpchp_configure_device(struct slot *p_slot)
	return ret;
	return ret;
}
}


int shpchp_unconfigure_device(struct slot *p_slot)
void shpchp_unconfigure_device(struct slot *p_slot)
{
{
	int rc = 0;
	struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
	struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
	struct pci_dev *dev, *temp;
	struct pci_dev *dev, *temp;
	struct controller *ctrl = p_slot->ctrl;
	struct controller *ctrl = p_slot->ctrl;
@@ -83,6 +82,4 @@ int shpchp_unconfigure_device(struct slot *p_slot)
	}
	}


	pci_unlock_rescan_remove();
	pci_unlock_rescan_remove();
	return rc;
}
}