diff mbox series

[v1] mmc: mmc_spi: Convert to use for_each_sg()

Message ID 20190830143916.21793-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v1] mmc: mmc_spi: Convert to use for_each_sg() | expand

Commit Message

Andy Shevchenko Aug. 30, 2019, 2:39 p.m. UTC
Use for_each_sg() macro instead of open coded variant.

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mmc/host/mmc_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ulf Hansson Sept. 3, 2019, 3:10 p.m. UTC | #1
On Fri, 30 Aug 2019 at 16:39, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Use for_each_sg() macro instead of open coded variant.
>
> No functional change intended.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mmc_spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
> index 19544b121276..66e354d51ee9 100644
> --- a/drivers/mmc/host/mmc_spi.c
> +++ b/drivers/mmc/host/mmc_spi.c
> @@ -891,7 +891,7 @@ mmc_spi_data_do(struct mmc_spi_host *host, struct mmc_command *cmd,
>         /* Handle scatterlist segments one at a time, with synch for
>          * each 512-byte block
>          */
> -       for (sg = data->sg, n_sg = data->sg_len; n_sg; n_sg--, sg++) {
> +       for_each_sg(data->sg, sg, data->sg_len, n_sg) {
>                 int                     status = 0;
>                 dma_addr_t              dma_addr = 0;
>                 void                    *kmap_addr;
> --
> 2.23.0.rc1
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 19544b121276..66e354d51ee9 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -891,7 +891,7 @@  mmc_spi_data_do(struct mmc_spi_host *host, struct mmc_command *cmd,
 	/* Handle scatterlist segments one at a time, with synch for
 	 * each 512-byte block
 	 */
-	for (sg = data->sg, n_sg = data->sg_len; n_sg; n_sg--, sg++) {
+	for_each_sg(data->sg, sg, data->sg_len, n_sg) {
 		int			status = 0;
 		dma_addr_t		dma_addr = 0;
 		void			*kmap_addr;