diff options
Diffstat (limited to 'arch/powerpc/lib/rheap.c')
-rw-r--r-- | arch/powerpc/lib/rheap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c index 57bf991ccd6e..6c5c5dd183ee 100644 --- a/arch/powerpc/lib/rheap.c +++ b/arch/powerpc/lib/rheap.c | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | #include <linux/kernel.h> | ||
17 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
18 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
19 | 20 | ||
@@ -85,7 +86,8 @@ static int grow(rh_info_t * info, int max_blocks) | |||
85 | info->flags &= ~RHIF_STATIC_BLOCK; | 86 | info->flags &= ~RHIF_STATIC_BLOCK; |
86 | 87 | ||
87 | /* add all new blocks to the free list */ | 88 | /* add all new blocks to the free list */ |
88 | for (i = 0, blk = block + info->max_blocks; i < new_blocks; i++, blk++) | 89 | blk = block + info->max_blocks - new_blocks; |
90 | for (i = 0; i < new_blocks; i++, blk++) | ||
89 | list_add(&blk->list, &info->empty_list); | 91 | list_add(&blk->list, &info->empty_list); |
90 | 92 | ||
91 | return 0; | 93 | return 0; |
@@ -670,7 +672,7 @@ void rh_dump(rh_info_t * info) | |||
670 | int maxnr; | 672 | int maxnr; |
671 | int i, nr; | 673 | int i, nr; |
672 | 674 | ||
673 | maxnr = sizeof(st) / sizeof(st[0]); | 675 | maxnr = ARRAY_SIZE(st); |
674 | 676 | ||
675 | printk(KERN_INFO | 677 | printk(KERN_INFO |
676 | "info @0x%p (%d slots empty / %d max)\n", | 678 | "info @0x%p (%d slots empty / %d max)\n", |