All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] libata: kill ata_acpi_on_suspend()
@ 2022-02-01 20:50 Sergey Shtylyov
  2022-02-02  8:08 ` Damien Le Moal
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Shtylyov @ 2022-02-01 20:50 UTC (permalink / raw)
  To: Damien Le Moal, linux-ide

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.

Changes in version 2:
- added the 'drivers/ata/libata.h' file update.

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

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);
 
Index: libata/drivers/ata/libata.h
===================================================================
--- libata.orig/drivers/ata/libata.h
+++ libata/drivers/ata/libata.h
@@ -107,7 +107,6 @@ static inline void ata_sas_free_tag(unsi
 #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);
@@ -117,7 +116,6 @@ extern void ata_acpi_bind_dev(struct ata
 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) { }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] libata: kill ata_acpi_on_suspend()
  2022-02-01 20:50 [PATCH v2] libata: kill ata_acpi_on_suspend() Sergey Shtylyov
@ 2022-02-02  8:08 ` Damien Le Moal
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2022-02-02  8:08 UTC (permalink / raw)
  To: Sergey Shtylyov, linux-ide

On 2/2/22 05:50, 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.
> 
> Changes in version 2:
> - added the 'drivers/ata/libata.h' file update.
> 
>  drivers/ata/libata-acpi.c |   21 ---------------------
>  drivers/ata/libata-eh.c   |    7 +------
>  drivers/ata/libata.h      |    2 --
>  3 files changed, 1 insertion(+), 29 deletions(-)

Applied to for-5.18 with a small change to the patch title:

ata: libata-ahci: kill ata_acpi_on_suspend()

Thanks !


-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-02  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01 20:50 [PATCH v2] libata: kill ata_acpi_on_suspend() Sergey Shtylyov
2022-02-02  8:08 ` Damien Le Moal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.