diff mbox series

libata: kill ata_acpi_on_suspend()

Message ID 6641085e-0459-fb1d-a8f1-c928e15ccc91@omp.ru
State New
Headers show
Series libata: kill ata_acpi_on_suspend() | expand

Commit Message

Sergey Shtylyov Feb. 1, 2022, 8:04 p.m. UTC
Since the commit c05e6ff035c1b25d17364a685432 ("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>

---
This patch is against the 'for-next' branch of Damien Le Moal's 'libata.git'
repo.

 drivers/ata/libata-acpi.c |   21 ---------------------
 drivers/ata/libata-eh.c   |    7 +------
 2 files changed, 1 insertion(+), 27 deletions(-)

Comments

Sergey Shtylyov Feb. 1, 2022, 8:45 p.m. UTC | #1
On 2/1/22 11:04 PM, Sergey Shtylyov wrote:

> Since the commit c05e6ff035c1b25d17364a685432 ("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>
> 
> ---
> This patch is against the 'for-next' branch of Damien Le Moal's 'libata.git'
> repo.
> 
>  drivers/ata/libata-acpi.c |   21 ---------------------
>  drivers/ata/libata-eh.c   |    7 +------
>  2 files changed, 1 insertion(+), 27 deletions(-)

  Grrr! drivers/ata/libata.h somehow wasn't included in the patch. I'll repost....

MBR, Sergey
diff mbox series

Patch

Index: libata/drivers/ata/libata-acpi.c
===================================================================
--- libata.orig/drivers/ata/libata-acpi.c
+++ libata/drivers/ata/libata-acpi.c
@@ -800,27 +800,6 @@  static int ata_acpi_push_id(struct ata_d
 }
 
 /**
- * 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
  *
Index: libata/drivers/ata/libata-eh.c
===================================================================
--- libata.orig/drivers/ata/libata-eh.c
+++ libata/drivers/ata/libata-eh.c
@@ -3902,11 +3902,6 @@  static void ata_eh_handle_port_suspend(s
 		}
 	}
 
-	/* tell ACPI we're suspending */
-	rc = ata_acpi_on_suspend(ap);
-	if (rc)
-		goto out;
-
 	/* suspend */
 	ata_eh_freeze_port(ap);
 
@@ -3914,7 +3909,7 @@  static void ata_eh_handle_port_suspend(s
 		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);