From: Pierre Ossman Date: Mon, 28 Jul 2008 23:09:37 +0000 (+0200) Subject: mmc: properly iterate over sg list in debug check X-Git-Tag: v2.6.27-rc2~107^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a84756c5735f28bf000617f18734a9e94426386a;p=linux-2.6-omap-h63xx.git mmc: properly iterate over sg list in debug check Signed-off-by: Pierre Ossman --- diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 3ee5b8c3b5c..044d84eeed7 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -121,6 +121,7 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) { #ifdef CONFIG_MMC_DEBUG unsigned int i, sz; + struct scatterlist *sg; #endif pr_debug("%s: starting CMD%u arg %08x flags %08x\n", @@ -156,8 +157,8 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) #ifdef CONFIG_MMC_DEBUG sz = 0; - for (i = 0;i < mrq->data->sg_len;i++) - sz += mrq->data->sg[i].length; + for_each_sg(mrq->data->sg, sg, mrq->data->sg_len, i) + sz += sg->length; BUG_ON(sz != mrq->data->blocks * mrq->data->blksz); #endif