Skip to contentSkip to conversation

ata: libata-eh: make ata_eh_qc_complete() and ata_eh_qc_retry() static

PATCH In review Damien Le Moal 2 participants 2 messages Jul 13 libata

lore
Share & tools
lore

Damien Le Moal

author maintainer
#0 lore raw

PATCH 1/1 ata: libata-eh: make ata_eh_qc_complete() and ata_eh_qc_retry() static

The functions ata_eh_qc_complete() and ata_eh_qc_retry() are used only in libata-eh.c. So remove the declaration of these functions from include/linux/libata.h and define them as static. While at it, add a missing blank line between variable declaration and code in these two functions.

No functional changes intended.

---
 drivers/ata/libata-eh.c | 6 ++++--
 include/linux/libata.h  | 3 ---
 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/ata/libata-eh.c +4 -2
index ff6d9f94ebed..11e8a28a7210 100644
@@ -1264,9 +1264,10 @@ static void __ata_eh_qc_complete(struct ata_queued_cmd *qc)
  *	Indicate to the mid and upper layers that an ATA command has
  *	completed.  To be used from EH.
  */
-void ata_eh_qc_complete(struct ata_queued_cmd *qc)
+static void ata_eh_qc_complete(struct ata_queued_cmd *qc)
 {
 	struct scsi_cmnd *scmd = qc->scsicmd;
+
 	scmd->retries = scmd->allowed;
 	__ata_eh_qc_complete(qc);
 }
@@ -1282,9 +1283,10 @@ void ata_eh_qc_complete(struct ata_queued_cmd *qc)
  *	scmd->allowed is incremented for commands which get retried
  *	due to unrelated failures (qc->err_mask is zero).
  */
-void ata_eh_qc_retry(struct ata_queued_cmd *qc)
+static void ata_eh_qc_retry(struct ata_queued_cmd *qc)
 {
 	struct scsi_cmnd *scmd = qc->scsicmd;
+
 	if (!qc->err_mask)
 		scmd->allowed++;
 	__ata_eh_qc_complete(qc);
include/linux/libata.h +0 -3
index 2ea7bfbdd867..224bbfd7c0d6 100644
@@ -1421,9 +1421,6 @@ extern int ata_port_freeze(struct ata_port *ap);
 extern void ata_eh_freeze_port(struct ata_port *ap);
 extern void ata_eh_thaw_port(struct ata_port *ap);
 
-extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
-extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
-
 extern void ata_std_error_handler(struct ata_port *ap)
 	__must_hold(&ap->host->eh_mutex);
 extern void ata_std_sched_eh(struct ata_port *ap);
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Damien Le Moal

The functions ata_eh_qc_complete() and ata_eh_qc_retry() are used only in libata-eh.c. So remove the declaration of these functions from include/linux/libata.h and define them as static. While at it, add a missing blank line between variable declaration and code in these two functions.

No functional changes intended.