mmc: block: Replace "goto retry" by a proper do / while loop
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 19 Dec 2016 14:03:45 +0000 (15:03 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 13 Feb 2017 12:19:53 +0000 (13:19 +0100)
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/block.c

index 5f942a34d65c668d20112eb670efb0cc5ebc2744..6648a17b96c08c57f5310a296e3957ac5bbded37 100644 (file)
@@ -1164,21 +1164,19 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
                arg = MMC_TRIM_ARG;
        else
                arg = MMC_ERASE_ARG;
-retry:
-       if (card->quirks & MMC_QUIRK_INAND_CMD38) {
-               err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-                                INAND_CMD38_ARG_EXT_CSD,
-                                arg == MMC_TRIM_ARG ?
-                                INAND_CMD38_ARG_TRIM :
-                                INAND_CMD38_ARG_ERASE,
-                                0);
-               if (err)
-                       goto out;
-       }
-       err = mmc_erase(card, from, nr, arg);
-out:
-       if (err == -EIO && !mmc_blk_reset(md, card->host, type))
-               goto retry;
+       do {
+               err = 0;
+               if (card->quirks & MMC_QUIRK_INAND_CMD38) {
+                       err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+                                        INAND_CMD38_ARG_EXT_CSD,
+                                        arg == MMC_TRIM_ARG ?
+                                        INAND_CMD38_ARG_TRIM :
+                                        INAND_CMD38_ARG_ERASE,
+                                        0);
+               }
+               if (!err)
+                       err = mmc_erase(card, from, nr, arg);
+       } while (err == -EIO && !mmc_blk_reset(md, card->host, type));
        if (!err)
                mmc_blk_reset_success(md, type);
 fail: