Skip to contentSkip to conversation

scsi: add megasas_dcmd_timeout helper

PATCH New Fanhui Meng 1 participant 3 messages Jul 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover scsi: add megasas_dcmd_timeout helper

This patch set contains small cleanups for megaraid_sas. Patch 1 adds a new helper megasas_dcmd_timeout() to reduce duplicate code. Patch 2 makes dcmd_timeout_ocr_possible() static.

Fanhui Meng (2):
scsi: megaraid_sas: Add megasas_dcmd_timeout helper
scsi: megaraid_sas: make dcmd_timeout_ocr_possible static

 drivers/scsi/megaraid/megaraid_sas.h      |   2 +
 drivers/scsi/megaraid/megaraid_sas_base.c | 203 ++++------------------
 2 files changed, 38 insertions(+), 167 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/2 scsi: megaraid_sas: Add megasas_dcmd_timeout helper

DCMD timeout is handled in many places, it makes sense to add a helper to handle it. This patch adds a new helper named megasas_dcmd_timeout() to reduce duplicate code.

---
 drivers/scsi/megaraid/megaraid_sas.h      |   2 +
 drivers/scsi/megaraid/megaraid_sas_base.c | 198 ++++------------------
 2 files changed, 35 insertions(+), 165 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +2 -0
index 5680c6cdb221..277f179157e8 100644
@@ -2760,5 +2760,7 @@ void megasas_exit_debugfs(void);
 void megasas_setup_debugfs(struct megasas_instance *instance);
 void megasas_destroy_debugfs(struct megasas_instance *instance);
 int megasas_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num);
+void megasas_dcmd_timeout(struct megasas_instance *instance,
+			  struct megasas_cmd *cmd);
 
 #endif				/*LSI_MEGARAID_SAS_H */
drivers/scsi/megaraid/megaraid_sas_base.c +33 -165

258 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 2/2 scsi: megaraid_sas: make dcmd_timeout_ocr_possible static

In reply to Fanhui Meng

dcmd_timeout_ocr_possible is only used in megaraid_sas_base.c, this patch makes it static. Furthermore, drop the useless "inline" label too.

---
 drivers/scsi/megaraid/megaraid_sas_base.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas_base.c +3 -2
index e6a9cef027c0..c9f6e691128e 100644
@@ -4516,8 +4516,9 @@ int megasas_alloc_cmds(struct megasas_instance *instance)
  * Return 0 for only Fusion adapter, if driver load/unload is not in progress
  * or FW is not under OCR.
  */
-inline int
-dcmd_timeout_ocr_possible(struct megasas_instance *instance) {
+static int
+dcmd_timeout_ocr_possible(struct megasas_instance *instance)
+{
 
 	if (instance->adapter_type == MFI_SERIES)
 		return KILL_ADAPTER;
Signature · 1 line
2.25.1