From 739c69c964fb4c040df451ef2e4cd6ea4f8b8e2d Mon Sep 17 00:00:00 2001 From: Per Forlin Date: Mon, 14 Nov 2011 12:04:24 +0100 Subject: mmc: mmc_test: align max_seg_size If max_seg_size is unaligned, mmc_test_map_sg() may create sg element sizes that are not aligned with 512 byte. Fix, align max_seg_size at mmc_test_area_init(). Signed-off-by: Per Forlin Signed-off-by: Chris Ball --- drivers/mmc/card/mmc_test.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/mmc/card/mmc_test.c') diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index b038c4a9468b..584899889e8f 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c @@ -1581,6 +1581,7 @@ static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill) t->max_segs = test->card->host->max_segs; t->max_seg_sz = test->card->host->max_seg_size; + t->max_seg_sz -= t->max_seg_sz % 512; t->max_tfr = t->max_sz; if (t->max_tfr >> 9 > test->card->host->max_blk_count) -- cgit v1.2.3