Commit 222d227f authored by ChanWoo Lee's avatar ChanWoo Lee Committed by Martin K. Petersen

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: default avatarChanWoo Lee <cw9316.lee@samsung.com>
Link: https://lore.kernel.org/r/20221111062301.7423-1-cw9316.lee@samsung.comSigned-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5277326d
......@@ -233,11 +233,6 @@ static bool ufshpb_test_ppn_dirty(struct ufshpb_lu *hpb, int rgn_idx,
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 @@ static bool ufshpb_test_ppn_dirty(struct ufshpb_lu *hpb, int rgn_idx,
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment