Commit 127883b8 authored by Vatika Harlalka's avatar Vatika Harlalka Committed by Greg Kroah-Hartman

Staging: rts5208: Add new variable idx to shorten line length and increase readability

Add new variable idx to shorten line length of other statements
and increase readability.
Signed-off-by: default avatarVatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7ef4ec4a
...@@ -2194,7 +2194,7 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no) ...@@ -2194,7 +2194,7 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no)
struct zone_entry *segment; struct zone_entry *segment;
bool defect_flag; bool defect_flag;
int retval, table_size, disable_cnt, i; int retval, table_size, disable_cnt, i;
u16 start, end, phy_blk, log_blk, tmp_blk; u16 start, end, phy_blk, log_blk, tmp_blk, idx;
u8 extra[MS_EXTRA_SIZE], us1, us2; u8 extra[MS_EXTRA_SIZE], us1, us2;
dev_dbg(rtsx_dev(chip), "ms_build_l2p_tbl: %d\n", seg_no); dev_dbg(rtsx_dev(chip), "ms_build_l2p_tbl: %d\n", seg_no);
...@@ -2305,13 +2305,15 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no) ...@@ -2305,13 +2305,15 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no)
continue; continue;
} }
if (segment->l2p_table[log_blk - ms_start_idx[seg_no]] == 0xFFFF) { idx = log_blk - ms_start_idx[seg_no];
segment->l2p_table[log_blk - ms_start_idx[seg_no]] = phy_blk;
if (segment->l2p_table[idx] == 0xFFFF) {
segment->l2p_table[idx] = phy_blk;
continue; continue;
} }
us1 = extra[0] & 0x10; us1 = extra[0] & 0x10;
tmp_blk = segment->l2p_table[log_blk - ms_start_idx[seg_no]]; tmp_blk = segment->l2p_table[idx];
retval = ms_read_extra_data(chip, tmp_blk, 0, retval = ms_read_extra_data(chip, tmp_blk, 0,
extra, MS_EXTRA_SIZE); extra, MS_EXTRA_SIZE);
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
...@@ -2342,7 +2344,8 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no) ...@@ -2342,7 +2344,8 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no)
for (log_blk = ms_start_idx[seg_no]; for (log_blk = ms_start_idx[seg_no];
log_blk < ms_start_idx[seg_no + 1]; log_blk++) { log_blk < ms_start_idx[seg_no + 1]; log_blk++) {
if (segment->l2p_table[log_blk-ms_start_idx[seg_no]] == 0xFFFF) { idx = log_blk - ms_start_idx[seg_no];
if (segment->l2p_table[idx] == 0xFFFF) {
phy_blk = ms_get_unused_block(chip, seg_no); phy_blk = ms_get_unused_block(chip, seg_no);
if (phy_blk == 0xFFFF) { if (phy_blk == 0xFFFF) {
chip->card_wp |= MS_CARD; chip->card_wp |= MS_CARD;
...@@ -2352,7 +2355,7 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no) ...@@ -2352,7 +2355,7 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no)
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, BUILD_FAIL); TRACE_GOTO(chip, BUILD_FAIL);
segment->l2p_table[log_blk-ms_start_idx[seg_no]] = phy_blk; segment->l2p_table[idx] = phy_blk;
if (seg_no == ms_card->segment_cnt - 1) { if (seg_no == ms_card->segment_cnt - 1) {
if (segment->unused_blk_cnt < 2) { if (segment->unused_blk_cnt < 2) {
chip->card_wp |= MS_CARD; chip->card_wp |= MS_CARD;
......
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