Skip to content

Commit

Permalink
mmc: properly iterate over sg list in debug check
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Pierre Ossman committed Aug 1, 2008
1 parent b7ac2cf commit a84756c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a84756c

Please sign in to comment.