Skip to content

Commit

Permalink
ata: libata-acpi: kill ata_acpi_on_suspend()
Browse files Browse the repository at this point in the history
Since the commit c05e6ff ("libata-acpi: implement
and use ata_acpi_init_gtm()") ata_acpi_on_suspend() just returns 0, so
its call from ata_eh_handle_port_suspend() doesn't make sense anymore.
Remove the function completely, at last...

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

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
  • Loading branch information
Sergey Shtylyov authored and Damien Le Moal committed Feb 2, 2022
1 parent 6e163f9 commit 2a7b02e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
21 changes: 0 additions & 21 deletions drivers/ata/libata-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,27 +799,6 @@ static int ata_acpi_push_id(struct ata_device *dev)
return 0;
}

/**
* ata_acpi_on_suspend - ATA ACPI hook called on suspend
* @ap: target ATA port
*
* This function is called when @ap is about to be suspended. All
* devices are already put to sleep but the port_suspend() callback
* hasn't been executed yet. Error return from this function aborts
* suspend.
*
* LOCKING:
* EH context.
*
* RETURNS:
* 0 on success, -errno on failure.
*/
int ata_acpi_on_suspend(struct ata_port *ap)
{
/* nada */
return 0;
}

/**
* ata_acpi_on_resume - ATA ACPI hook called on resume
* @ap: target ATA port
Expand Down
7 changes: 1 addition & 6 deletions drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -3902,19 +3902,14 @@ static void ata_eh_handle_port_suspend(struct ata_port *ap)
}
}

/* tell ACPI we're suspending */
rc = ata_acpi_on_suspend(ap);
if (rc)
goto out;

/* suspend */
ata_eh_freeze_port(ap);

if (ap->ops->port_suspend)
rc = ap->ops->port_suspend(ap, ap->pm_mesg);

ata_acpi_set_state(ap, ap->pm_mesg);
out:

/* update the flags */
spin_lock_irqsave(ap->lock, flags);

Expand Down
2 changes: 0 additions & 2 deletions drivers/ata/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ static inline void ata_sas_free_tag(unsigned int tag, struct ata_port *ap) { }
#ifdef CONFIG_ATA_ACPI
extern unsigned int ata_acpi_gtf_filter;
extern void ata_acpi_dissociate(struct ata_host *host);
extern int ata_acpi_on_suspend(struct ata_port *ap);
extern void ata_acpi_on_resume(struct ata_port *ap);
extern int ata_acpi_on_devcfg(struct ata_device *dev);
extern void ata_acpi_on_disable(struct ata_device *dev);
Expand All @@ -117,7 +116,6 @@ extern void ata_acpi_bind_dev(struct ata_device *dev);
extern acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
#else
static inline void ata_acpi_dissociate(struct ata_host *host) { }
static inline int ata_acpi_on_suspend(struct ata_port *ap) { return 0; }
static inline void ata_acpi_on_resume(struct ata_port *ap) { }
static inline int ata_acpi_on_devcfg(struct ata_device *dev) { return 0; }
static inline void ata_acpi_on_disable(struct ata_device *dev) { }
Expand Down

0 comments on commit 2a7b02e

Please sign in to comment.