Skip to contentSkip to conversation

scsi: mpt3sas: Modify the comment and exception return value of function _base_get_event_diag_triggers()

PATCH New Gu Mi 1 participant 2 messages Sep 19, 2022 – Sep 22, 2022

Subsystems (2)
lore
Share & tools
lore

Gu Mi

author
#0 lore raw

PATCH 1/1 scsi: mpt3sas: Modify the comment and exception return value of function _base_get_event_diag_triggers()

For function _base_get_event_diag_triggers(), it has a return value, but the description of the comment information is incorrect. In addition, in the abnormal process, 0 should not be returned, 0 means success, here an abnormal value needs to be return, In order to retry after an exception occurs, the setting returns to -EAGAIN, from code analysis, it will not cause infinite retries.

---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +2 -1
index 565339a..dabbab6 100644
@@ -5025,7 +5025,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc,
  *				persistent pages
  * @ioc : per adapter object
  *
- * Return: nothing.
+ * Return: zero on success; otherwise return EAGAIN error codes
+ * asking the caller to retry.
  */
 static int

_base_get_event_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
@@ -5050,7 +5050,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc,
ioc_err(ioc,
"%s: Failed to get trigger pg2, ioc_status(0x%04x)\n",
__func__, ioc_status));
- return 0;
+ return -EAGAIN;
}

if (le16_to_cpu(trigger_pg2.NumMPIEventTrigger)) {

Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/1 scsi: mpt3sas: Modify the comment and exception return value of function _base_get_event_diag_triggers()

Quoted 36 lines

For function _base_get_event_diag_triggers(), it has a return value, but the description of the comment information is incorrect. In addition, in the abnormal process, 0 should not be returned, 0 means success, here an abnormal value needs to be return, In order to retry after an exception occurs, the setting returns to -EAGAIN, from code analysis, it will not cause infinite retries.

---
  drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +3 -2
index 565339a..dabbab6 100644
@@ -5025,7 +5025,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc,
   *				persistent pages
   * @ioc : per adapter object
   *
- * Return: nothing.
+ * Return: zero on success; otherwise return EAGAIN error codes
+ * asking the caller to retry.
   */
  static int
  _base_get_event_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
@@ -5050,7 +5050,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc,
  		    ioc_err(ioc,
  		    "%s: Failed to get trigger pg2, ioc_status(0x%04x)\n",
  		   __func__, ioc_status));
-		return 0;
+		return -EAGAIN;
  	}
 
  	if (le16_to_cpu(trigger_pg2.NumMPIEventTrigger)) {