scsi: ufs: wb: Change wb_enabled condition test
authorJinyoung Choi <j-young.choi@samsung.com>
Thu, 4 Aug 2022 07:49:28 +0000 (16:49 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 23 Aug 2022 03:15:10 +0000 (23:15 -0400)
Change to improve readability.

Link: https://lore.kernel.org/r/20220804074928epcms2p86582693a39597501b491400a28543a92@epcms2p8
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c

index 285e099385cd92022fcc1274ec8dec1fc827d6cb..1c535d63fde015d0c7b8b6ededa75a4985d61445 100644 (file)
@@ -5758,10 +5758,8 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable)
 {
        int ret;
 
-       if (!ufshcd_is_wb_allowed(hba))
-               return 0;
-
-       if (!(enable ^ hba->dev_info.wb_enabled))
+       if (!ufshcd_is_wb_allowed(hba) ||
+           hba->dev_info.wb_enabled == enable)
                return 0;
 
        ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_EN);