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>
This commit is contained in:
ChanWoo Lee 2022-11-11 15:23:01 +09:00 committed by Martin K. Petersen
parent 5277326d07
commit 222d227f37

View File

@ -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