diff options
author | ChanWoo Lee <cw9316.lee@samsung.com> | 2022-11-11 15:23:01 +0900 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-11-25 23:45:18 +0000 |
commit | 222d227f375b4cfa517a8f1f0f266ebe0263ad05 (patch) | |
tree | 0d15b5de401b0389d3cce4ffaf912c0ae9c574a1 /drivers/ufs | |
parent | 5277326d07fbf68aa7fc9e7bce6c381002e00fca (diff) | |
download | linux-stable-222d227f375b4cfa517a8f1f0f266ebe0263ad05.tar.gz linux-stable-222d227f375b4cfa517a8f1f0f266ebe0263ad05.tar.bz2 linux-stable-222d227f375b4cfa517a8f1f0f266ebe0263ad05.zip |
scsi: ufs: core: Fix unnecessary operation for early return
Setting bitmap_len is not required when returning early. Defer until it is
needed.
Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>
Link: https://lore.kernel.org/r/20221111062301.7423-1-cw9316.lee@samsung.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs')
-rw-r--r-- | drivers/ufs/core/ufshpb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/ufs/core/ufshpb.c b/drivers/ufs/core/ufshpb.c index fda3e7b494a6..be3fb24b93d8 100644 --- a/drivers/ufs/core/ufshpb.c +++ b/drivers/ufs/core/ufshpb.c @@ -233,11 +233,6 @@ next_srgn: rgn = hpb->rgn_tbl + rgn_idx; srgn = rgn->srgn_tbl + srgn_idx; - if (likely(!srgn->is_last)) - bitmap_len = hpb->entries_per_srgn; - else - bitmap_len = hpb->last_srgn_entries; - if (!ufshpb_is_valid_srgn(rgn, srgn)) return true; @@ -253,6 +248,11 @@ next_srgn: return true; } + if (likely(!srgn->is_last)) + bitmap_len = hpb->entries_per_srgn; + else + bitmap_len = hpb->last_srgn_entries; + if ((srgn_offset + cnt) > bitmap_len) bit_len = bitmap_len - srgn_offset; else |