diff mbox series

[2/2] scsi: ufs: Simplify a condition

Message ID 20191213104935.wgpq2epaz6zh5zus@kili.mountain (mailing list archive)
State Mainlined
Commit dc30c9e6d67f9edb02d543e1f213f3250bfa3a78
Headers show
Series [1/2] scsi: ufs: Unlock on a couple error paths | expand

Commit Message

Dan Carpenter Dec. 13, 2019, 10:49 a.m. UTC
We know that "check_for_bkops" is non-zero on this side of the ||
because it was checked on the other side.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/ufs/ufshcd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Bart Van Assche Dec. 13, 2019, 8:05 p.m. UTC | #1
On 12/13/19 5:49 AM, Dan Carpenter wrote:
> We know that "check_for_bkops" is non-zero on this side of the ||
> because it was checked on the other side.

How about also removing the superfluous parentheses? Anyway:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Dan Carpenter Dec. 14, 2019, 4:28 a.m. UTC | #2
On Fri, Dec 13, 2019 at 01:05:55PM -0700, Bart Van Assche wrote:
> On 12/13/19 5:49 AM, Dan Carpenter wrote:
> > We know that "check_for_bkops" is non-zero on this side of the ||
> > because it was checked on the other side.
> 
> How about also removing the superfluous parentheses? Anyway:
> 

Around "(req_link_state == UIC_LINK_OFF_STATE)"?  I considered it but
some people like them...

regards,
dan carpenter
Avri Altman Dec. 15, 2019, 6:06 a.m. UTC | #3
> 
> We know that "check_for_bkops" is non-zero on this side of the || because it
> was checked on the other side.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

> ---
>  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
> bf981f0ea74c..c299c5feaf1a 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -7684,8 +7684,7 @@ static int ufshcd_link_state_transition(struct ufs_hba
> *hba,
>          * turning off the link would also turn off the device.
>          */
>         else if ((req_link_state == UIC_LINK_OFF_STATE) &&
> -                  (!check_for_bkops || (check_for_bkops &&
> -                   !hba->auto_bkops_enabled))) {
> +                (!check_for_bkops || !hba->auto_bkops_enabled)) {
>                 /*
>                  * Let's make sure that link is in low power mode, we are doing
>                  * this currently by putting the link in Hibern8. Otherway to
> --
> 2.11.0
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index bf981f0ea74c..c299c5feaf1a 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7684,8 +7684,7 @@  static int ufshcd_link_state_transition(struct ufs_hba *hba,
 	 * turning off the link would also turn off the device.
 	 */
 	else if ((req_link_state == UIC_LINK_OFF_STATE) &&
-		   (!check_for_bkops || (check_for_bkops &&
-		    !hba->auto_bkops_enabled))) {
+		 (!check_for_bkops || !hba->auto_bkops_enabled)) {
 		/*
 		 * Let's make sure that link is in low power mode, we are doing
 		 * this currently by putting the link in Hibern8. Otherway to