diff mbox series

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

Message ID 1663580962-64851-1-git-send-email-gumi@linux.alibaba.com
State New
Headers show
Series scsi: mpt3sas: Modify the comment and exception return value of function _base_get_event_diag_triggers() | expand

Commit Message

Gu Mi Sept. 19, 2022, 9:49 a.m. UTC
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.

Signed-off-by: Gu Mi <gumi@linux.alibaba.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Gu Mi Sept. 22, 2022, 8:13 a.m. UTC | #1
> 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.
>
> Signed-off-by: Gu Mi <gumi@linux.alibaba.com>
> ---
>   drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
> index 565339a..dabbab6 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
> @@ -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)) {
diff mbox series

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 565339a..dabbab6 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -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)) {