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 |
> 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 --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)) {
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(-)