scsi: ufs: core: Fix unnecessary operation for early return
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): CGME20221111062328epcas1p2c2d1f52fed1068579a1dad7fb4e60f52@epcas1p2.samsung.com
PATCH 1/1 scsi: ufs: core: Fix unnecessary operation for early return
From: ChanWoo Lee <[email protected]>
For early return, bitmap_len operation is not required. Modified to reduce unnecessary operations.
Signed-off-by ChanWoo Lee <[email protected]>
--- drivers/ufs/core/ufshpb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/ufs/core/ufshpb.c +5 -5
@@ -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
Signature · 1 line
2.29.0
Martin K. Petersen
AppliedChanwoo,
Quoted 2 lines
For early return,
bitmap_lenoperation is not required. Modified to reduce unnecessary operations.
Applied to 6.2/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 6 lines · Chanwoo Lee
From: ChanWoo Lee <[email protected]>
For early return,
bitmap_lenoperation is not required. Modified to reduce unnecessary operations.
Applied to 6.2/scsi-queue, thanks!
[1/1] scsi: ufs: core: Fix unnecessary operation for early return
https://git.kernel.org/mkp/scsi/c/222d227f375b
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering