Commit ec87cf37 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Damien Le Moal
Browse files

ata: libata: make ata_host_suspend() *void*



ata_host_suspend() always returns 0, so the result checks in many drivers
look pointless.  Let's make this function return *void* instead of *int*.

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent ac1eb665
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -891,7 +891,8 @@ static int ahci_pci_device_suspend(struct device *dev)
	}

	ahci_pci_disable_interrupts(host);
	return ata_host_suspend(host, PMSG_SUSPEND);
	ata_host_suspend(host, PMSG_SUSPEND);
	return 0;
}

static int ahci_pci_device_resume(struct device *dev)
+1 −4
Original line number Diff line number Diff line
@@ -993,11 +993,8 @@ static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
	struct ata_host *host = pci_get_drvdata(pdev);
	unsigned long flags;
	int rc = 0;

	rc = ata_host_suspend(host, mesg);
	if (rc)
		return rc;
	ata_host_suspend(host, mesg);

	/* Some braindamaged ACPI suspend implementations expect the
	 * controller to be awake on entry; otherwise, it burns cpu
+2 −1
Original line number Diff line number Diff line
@@ -733,7 +733,8 @@ int ahci_platform_suspend_host(struct device *dev)
	if (hpriv->flags & AHCI_HFLAG_SUSPEND_PHYS)
		ahci_platform_disable_phys(hpriv);

	return ata_host_suspend(host, PMSG_SUSPEND);
	ata_host_suspend(host, PMSG_SUSPEND);
	return 0;
}
EXPORT_SYMBOL_GPL(ahci_platform_suspend_host);

+2 −6
Original line number Diff line number Diff line
@@ -5170,10 +5170,9 @@ EXPORT_SYMBOL_GPL(ata_sas_port_resume);
 *
 *	Suspend @host.  Actual operation is performed by port suspend.
 */
int ata_host_suspend(struct ata_host *host, pm_message_t mesg)
void ata_host_suspend(struct ata_host *host, pm_message_t mesg)
{
	host->dev->power.power_state = mesg;
	return 0;
}
EXPORT_SYMBOL_GPL(ata_host_suspend);

@@ -6090,11 +6089,8 @@ EXPORT_SYMBOL_GPL(ata_pci_device_do_resume);
int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
	struct ata_host *host = pci_get_drvdata(pdev);
	int rc = 0;

	rc = ata_host_suspend(host, mesg);
	if (rc)
		return rc;
	ata_host_suspend(host, mesg);

	ata_pci_device_do_suspend(pdev, mesg);

+2 −1
Original line number Diff line number Diff line
@@ -937,7 +937,8 @@ static int arasan_cf_suspend(struct device *dev)
		dmaengine_terminate_all(acdev->dma_chan);

	cf_exit(acdev);
	return ata_host_suspend(host, PMSG_SUSPEND);
	ata_host_suspend(host, PMSG_SUSPEND);
	return 0;
}

static int arasan_cf_resume(struct device *dev)
Loading