Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218982
b: refs/heads/master
c: 3d203be
h: refs/heads/master
v: v3
  • Loading branch information
Adrian Hunter authored and Chris Ball committed Oct 23, 2010
1 parent 13590f0 commit 949d3ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 130067ed15f6e8a1209898646878f5bc0a17d3dd
refs/heads/master: 3d203be833068c0f633878743d0c08d6acd24b58
12 changes: 6 additions & 6 deletions trunk/drivers/mmc/card/mmc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz,

if (max_page_cnt > limit)
max_page_cnt = limit;
if (max_page_cnt < min_page_cnt)
max_page_cnt = min_page_cnt;
if (min_page_cnt > max_page_cnt)
min_page_cnt = max_page_cnt;

if (max_seg_page_cnt > max_page_cnt)
max_seg_page_cnt = max_page_cnt;
Expand Down Expand Up @@ -359,13 +359,13 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz,
mem->cnt += 1;
if (max_page_cnt <= (1UL << order))
break;
max_page_cnt -= 1UL << order;
page_cnt += 1UL << order;
if (mem->cnt >= max_segs) {
if (page_cnt < min_page_cnt)
goto out_free;
break;
}
max_page_cnt -= 1UL << order;
page_cnt += 1UL << order;
}

return mem;
Expand Down Expand Up @@ -1470,12 +1470,12 @@ static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill)
t->max_tfr = t->max_segs * t->max_seg_sz;

/*
* Try to allocate enough memory for the whole area. Less is OK
* Try to allocate enough memory for a max. sized transfer. Less is OK
* because the same memory can be mapped into the scatterlist more than
* once. Also, take into account the limits imposed on scatterlist
* segments by the host driver.
*/
t->mem = mmc_test_alloc_mem(min_sz, t->max_sz, t->max_segs,
t->mem = mmc_test_alloc_mem(min_sz, t->max_tfr, t->max_segs,
t->max_seg_sz);
if (!t->mem)
return -ENOMEM;
Expand Down

0 comments on commit 949d3ec

Please sign in to comment.