diff mbox series

[101/117] ufs: Remove an assignment from ufshcd_transfer_rsp_status()

Message ID 20210420021402.27678-11-bvanassche@acm.org
State New
Headers show
Series Make better use of static type checking | expand

Commit Message

Bart Van Assche April 20, 2021, 2:13 a.m. UTC
Since a later patch will change the type of the 'result' variable, use this
variable only for one purpose.

Cc: Can Guo <cang@codeaurora.org>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ufs/ufshcd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Can Guo May 7, 2021, 12:03 a.m. UTC | #1
On 2021-04-20 10:13, Bart Van Assche wrote:
> Since a later patch will change the type of the 'result' variable, use 

> this

> variable only for one purpose.

> 

> Cc: Can Guo <cang@codeaurora.org>

> Cc: Avri Altman <avri.altman@wdc.com>

> Cc: Bean Huo <beanhuo@micron.com>

> Cc: Alim Akhtar <alim.akhtar@samsung.com>

> Cc: Asutosh Das <asutoshd@codeaurora.org>

> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

> ---

>  drivers/scsi/ufs/ufshcd.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

> index 391947e4db72..d966d80838fb 100644

> --- a/drivers/scsi/ufs/ufshcd.c

> +++ b/drivers/scsi/ufs/ufshcd.c

> @@ -4947,9 +4947,8 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba,

> struct ufshcd_lrb *lrbp)

> 

>  	switch (ocs) {

>  	case OCS_SUCCESS:

> -		result = ufshcd_get_req_rsp(lrbp->ucd_rsp_ptr);

>  		hba->ufs_stats.last_hibern8_exit_tstamp = ktime_set(0, 0);

> -		switch (result) {

> +		switch (ufshcd_get_req_rsp(lrbp->ucd_rsp_ptr)) {

>  		case UPIU_TRANSACTION_RESPONSE:

>  			/* Propagate the SCSI status to the SCSI midlayer. */

>  			result = ufshcd_scsi_cmd_status(lrbp,


Reviewed-by: Can Guo <cang@codeaurora.org>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 391947e4db72..d966d80838fb 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4947,9 +4947,8 @@  ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
 
 	switch (ocs) {
 	case OCS_SUCCESS:
-		result = ufshcd_get_req_rsp(lrbp->ucd_rsp_ptr);
 		hba->ufs_stats.last_hibern8_exit_tstamp = ktime_set(0, 0);
-		switch (result) {
+		switch (ufshcd_get_req_rsp(lrbp->ucd_rsp_ptr)) {
 		case UPIU_TRANSACTION_RESPONSE:
 			/* Propagate the SCSI status to the SCSI midlayer. */
 			result = ufshcd_scsi_cmd_status(lrbp,