Skip to content

Commit 5744d50

Browse files
linuswstorulf
authored andcommitted
mmc: core: move some code in mmc_start_areq()
"previous" is a better name for the variable storing the previous asynchronous request, better than the opaque name "data" atleast. We see that we assign the return status to the returned variable on all code paths, so we might as well just do that immediately after calling mmc_finalize_areq(). Reviewed-by: Bartlomiej Zolnierkiewicz <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent f34bdd2 commit 5744d50

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/mmc/core/core.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -704,21 +704,20 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host,
704704
{
705705
enum mmc_blk_status status;
706706
int start_err = 0;
707-
struct mmc_async_req *data = host->areq;
707+
struct mmc_async_req *previous = host->areq;
708708

709709
/* Prepare a new request */
710710
if (areq)
711711
mmc_pre_req(host, areq->mrq);
712712

713713
/* Finalize previous request */
714714
status = mmc_finalize_areq(host);
715+
if (ret_stat)
716+
*ret_stat = status;
715717

716718
/* The previous request is still going on... */
717-
if (status == MMC_BLK_NEW_REQUEST) {
718-
if (ret_stat)
719-
*ret_stat = status;
719+
if (status == MMC_BLK_NEW_REQUEST)
720720
return NULL;
721-
}
722721

723722
/* Fine so far, start the new request! */
724723
if (status == MMC_BLK_SUCCESS && areq)
@@ -737,9 +736,7 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host,
737736
else
738737
host->areq = areq;
739738

740-
if (ret_stat)
741-
*ret_stat = status;
742-
return data;
739+
return previous;
743740
}
744741
EXPORT_SYMBOL(mmc_start_areq);
745742

0 commit comments

Comments
 (0)