diff options
author | Vatika Harlalka <vatikaharlalka@gmail.com> | 2015-03-19 03:14:15 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-20 13:28:22 +0100 |
commit | 127883b803c7c602a348c49963b4b10cd2d21e92 (patch) | |
tree | c13a3a63aecd3b19fabc6c3752f86da1b73585be /drivers/staging/rts5208/ms.c | |
parent | 7ef4ec4a653c2fb71d70e5c23bf2f37253b5da01 (diff) |
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: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208/ms.c')
-rw-r--r-- | drivers/staging/rts5208/ms.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 5a9321b4d798..4c38ff9d9a76 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -2194,7 +2194,7 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no) struct zone_entry *segment; bool defect_flag; 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; 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) continue; } - if (segment->l2p_table[log_blk - ms_start_idx[seg_no]] == 0xFFFF) { - segment->l2p_table[log_blk - ms_start_idx[seg_no]] = phy_blk; + idx = log_blk - ms_start_idx[seg_no]; + + if (segment->l2p_table[idx] == 0xFFFF) { + segment->l2p_table[idx] = phy_blk; continue; } 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, extra, MS_EXTRA_SIZE); if (retval != STATUS_SUCCESS) @@ -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]; 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); if (phy_blk == 0xFFFF) { chip->card_wp |= MS_CARD; @@ -2352,7 +2355,7 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no) if (retval != STATUS_SUCCESS) 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 (segment->unused_blk_cnt < 2) { chip->card_wp |= MS_CARD; |