Message ID | 20210305060908.2476850-1-ipylypiv@google.com |
---|---|
State | New |
Headers | show |
Series | scsi: pm80xx: Replace magic numbers with device state defines | expand |
On Fri, Mar 5, 2021 at 7:11 AM Igor Pylypiv <ipylypiv@google.com> wrote: > > This improves the code readability. > > Signed-off-by: Igor Pylypiv <ipylypiv@google.com> Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com> Thanks! > --- > drivers/scsi/pm8001/pm8001_sas.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c > index a98d4496ff8b..0cbd25a2ee9f 100644 > --- a/drivers/scsi/pm8001/pm8001_sas.c > +++ b/drivers/scsi/pm8001/pm8001_sas.c > @@ -738,7 +738,7 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev, > if (pm8001_ha->chip_id != chip_8001) { > pm8001_dev->setds_completion = &completion_setstate; > PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, > - pm8001_dev, 0x01); > + pm8001_dev, DS_OPERATIONAL); > wait_for_completion(&completion_setstate); > } > res = -TMF_RESP_FUNC_FAILED; > @@ -1110,7 +1110,7 @@ int pm8001_lu_reset(struct domain_device *dev, u8 *lun) > sas_put_local_phy(phy); > pm8001_dev->setds_completion = &completion_setstate; > rc = PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, > - pm8001_dev, 0x01); > + pm8001_dev, DS_OPERATIONAL); > wait_for_completion(&completion_setstate); > } else { > tmf_task.tmf = TMF_LU_RESET; > @@ -1229,7 +1229,7 @@ int pm8001_abort_task(struct sas_task *task) > /* 1. Set Device state as Recovery */ > pm8001_dev->setds_completion = &completion; > PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, > - pm8001_dev, 0x03); > + pm8001_dev, DS_IN_RECOVERY); > wait_for_completion(&completion); > > /* 2. Send Phy Control Hard Reset */ > @@ -1300,7 +1300,7 @@ int pm8001_abort_task(struct sas_task *task) > reinit_completion(&completion); > pm8001_dev->setds_completion = &completion; > PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, > - pm8001_dev, 0x01); > + pm8001_dev, DS_OPERATIONAL); > wait_for_completion(&completion); > } else { > rc = pm8001_exec_internal_task_abort(pm8001_ha, > -- > 2.30.1.766.gb4fecdf3b7-goog >
Igor,
> This improves the code readability.
Applied to 5.13/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
On Thu, 4 Mar 2021 22:09:08 -0800, Igor Pylypiv wrote:
> This improves the code readability.
Applied to 5.13/scsi-queue, thanks!
[1/1] scsi: pm80xx: Replace magic numbers with device state defines
https://git.kernel.org/mkp/scsi/c/9ec3d4c10565
--
Martin K. Petersen Oracle Linux Engineering
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index a98d4496ff8b..0cbd25a2ee9f 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -738,7 +738,7 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev, if (pm8001_ha->chip_id != chip_8001) { pm8001_dev->setds_completion = &completion_setstate; PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, - pm8001_dev, 0x01); + pm8001_dev, DS_OPERATIONAL); wait_for_completion(&completion_setstate); } res = -TMF_RESP_FUNC_FAILED; @@ -1110,7 +1110,7 @@ int pm8001_lu_reset(struct domain_device *dev, u8 *lun) sas_put_local_phy(phy); pm8001_dev->setds_completion = &completion_setstate; rc = PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, - pm8001_dev, 0x01); + pm8001_dev, DS_OPERATIONAL); wait_for_completion(&completion_setstate); } else { tmf_task.tmf = TMF_LU_RESET; @@ -1229,7 +1229,7 @@ int pm8001_abort_task(struct sas_task *task) /* 1. Set Device state as Recovery */ pm8001_dev->setds_completion = &completion; PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, - pm8001_dev, 0x03); + pm8001_dev, DS_IN_RECOVERY); wait_for_completion(&completion); /* 2. Send Phy Control Hard Reset */ @@ -1300,7 +1300,7 @@ int pm8001_abort_task(struct sas_task *task) reinit_completion(&completion); pm8001_dev->setds_completion = &completion; PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, - pm8001_dev, 0x01); + pm8001_dev, DS_OPERATIONAL); wait_for_completion(&completion); } else { rc = pm8001_exec_internal_task_abort(pm8001_ha,
This improves the code readability. Signed-off-by: Igor Pylypiv <ipylypiv@google.com> --- drivers/scsi/pm8001/pm8001_sas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)