Commit e453eecb authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: rts5208: fix style warnings in xd.c

This patch fixes the following checkpatch.pl warning in xd.c:
WARNING: else is not generally useful after a break or return

It also makes code more uniform with the new changes
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e040b626
...@@ -1622,10 +1622,8 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, ...@@ -1622,10 +1622,8 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk,
u8 reg_val, page_cnt; u8 reg_val, page_cnt;
int zone_no, retval, i; int zone_no, retval, i;
if (start_page > end_page) { if (start_page > end_page)
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
}
page_cnt = end_page - start_page; page_cnt = end_page - start_page;
zone_no = (int)(log_blk / 1000); zone_no = (int)(log_blk / 1000);
...@@ -1641,8 +1639,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, ...@@ -1641,8 +1639,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk,
if (detect_card_cd(chip, XD_CARD) != STATUS_SUCCESS) { if (detect_card_cd(chip, XD_CARD) != STATUS_SUCCESS) {
xd_set_err_code(chip, XD_NO_CARD); xd_set_err_code(chip, XD_NO_CARD);
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
} }
} }
} }
...@@ -1677,8 +1674,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, ...@@ -1677,8 +1674,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk,
if (retval == -ETIMEDOUT) { if (retval == -ETIMEDOUT) {
xd_set_err_code(chip, XD_TO_ERROR); xd_set_err_code(chip, XD_TO_ERROR);
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
} else { } else {
rtsx_trace(chip); rtsx_trace(chip);
goto Fail; goto Fail;
...@@ -1711,8 +1707,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, ...@@ -1711,8 +1707,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk,
if (detect_card_cd(chip, XD_CARD) != STATUS_SUCCESS) { if (detect_card_cd(chip, XD_CARD) != STATUS_SUCCESS) {
xd_set_err_code(chip, XD_NO_CARD); xd_set_err_code(chip, XD_NO_CARD);
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
} }
xd_set_err_code(chip, XD_ECC_ERROR); xd_set_err_code(chip, XD_ECC_ERROR);
...@@ -1720,8 +1715,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, ...@@ -1720,8 +1715,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk,
new_blk = xd_get_unused_block(chip, zone_no); new_blk = xd_get_unused_block(chip, zone_no);
if (new_blk == NO_NEW_BLK) { if (new_blk == NO_NEW_BLK) {
XD_CLR_BAD_OLDBLK(xd_card); XD_CLR_BAD_OLDBLK(xd_card);
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
} }
retval = xd_copy_page(chip, phy_blk, new_blk, 0, retval = xd_copy_page(chip, phy_blk, new_blk, 0,
...@@ -1735,8 +1729,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, ...@@ -1735,8 +1729,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk,
XD_CLR_BAD_NEWBLK(xd_card); XD_CLR_BAD_NEWBLK(xd_card);
} }
XD_CLR_BAD_OLDBLK(xd_card); XD_CLR_BAD_OLDBLK(xd_card);
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
} }
xd_set_l2p_tbl(chip, zone_no, log_off, (u16)(new_blk & 0x3FF)); xd_set_l2p_tbl(chip, zone_no, log_off, (u16)(new_blk & 0x3FF));
xd_erase_block(chip, phy_blk); xd_erase_block(chip, phy_blk);
...@@ -1744,6 +1737,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, ...@@ -1744,6 +1737,7 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk,
XD_CLR_BAD_OLDBLK(xd_card); XD_CLR_BAD_OLDBLK(xd_card);
} }
Status_Fail:
rtsx_trace(chip); rtsx_trace(chip);
return STATUS_FAIL; return STATUS_FAIL;
} }
...@@ -1842,10 +1836,8 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, ...@@ -1842,10 +1836,8 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk,
dev_dbg(rtsx_dev(chip), "%s, old_blk = 0x%x, new_blk = 0x%x, log_blk = 0x%x\n", dev_dbg(rtsx_dev(chip), "%s, old_blk = 0x%x, new_blk = 0x%x, log_blk = 0x%x\n",
__func__, old_blk, new_blk, log_blk); __func__, old_blk, new_blk, log_blk);
if (start_page > end_page) { if (start_page > end_page)
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
}
page_cnt = end_page - start_page; page_cnt = end_page - start_page;
zone_no = (int)(log_blk / 1000); zone_no = (int)(log_blk / 1000);
...@@ -1854,10 +1846,8 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, ...@@ -1854,10 +1846,8 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk,
page_addr = (new_blk << xd_card->block_shift) + start_page; page_addr = (new_blk << xd_card->block_shift) + start_page;
retval = xd_send_cmd(chip, READ1_1); retval = xd_send_cmd(chip, READ1_1);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
}
rtsx_init_cmd(chip); rtsx_init_cmd(chip);
...@@ -1892,8 +1882,7 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, ...@@ -1892,8 +1882,7 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk,
if (retval == -ETIMEDOUT) { if (retval == -ETIMEDOUT) {
xd_set_err_code(chip, XD_TO_ERROR); xd_set_err_code(chip, XD_TO_ERROR);
rtsx_trace(chip); goto Status_Fail;
return STATUS_FAIL;
} else { } else {
rtsx_trace(chip); rtsx_trace(chip);
goto Fail; goto Fail;
...@@ -1933,6 +1922,7 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, ...@@ -1933,6 +1922,7 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk,
xd_mark_bad_block(chip, new_blk); xd_mark_bad_block(chip, new_blk);
} }
Status_Fail:
rtsx_trace(chip); rtsx_trace(chip);
return STATUS_FAIL; return STATUS_FAIL;
} }
......
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