mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
mm/cma.c: switch to bitmap_zalloc() for cma bitmap allocation
[ Upstream commit 2184f9928ab52f26c2ae5e9ba37faf29c78f50b8 ] kzalloc() is used for cma bitmap allocation in cma_activate_area(), switch to bitmap_zalloc() for clarity. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Yunfeng Ye <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Yue Hu <[email protected]> Cc: Peng Fan <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Ryohei Suzuki <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: Doug Berger <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
965d3d5ce3
commit
aed14b1b5c
1 changed files with 2 additions and 4 deletions
6
mm/cma.c
6
mm/cma.c
|
|
@ -95,13 +95,11 @@ static void cma_clear_bitmap(struct cma *cma, unsigned long pfn,
|
|||
|
||||
static int __init cma_activate_area(struct cma *cma)
|
||||
{
|
||||
int bitmap_size = BITS_TO_LONGS(cma_bitmap_maxno(cma)) * sizeof(long);
|
||||
unsigned long base_pfn = cma->base_pfn, pfn = base_pfn;
|
||||
unsigned i = cma->count >> pageblock_order;
|
||||
struct zone *zone;
|
||||
|
||||
cma->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
|
||||
|
||||
cma->bitmap = bitmap_zalloc(cma_bitmap_maxno(cma), GFP_KERNEL);
|
||||
if (!cma->bitmap) {
|
||||
cma->count = 0;
|
||||
return -ENOMEM;
|
||||
|
|
@ -139,7 +137,7 @@ static int __init cma_activate_area(struct cma *cma)
|
|||
|
||||
not_in_zone:
|
||||
pr_err("CMA area %s could not be activated\n", cma->name);
|
||||
kfree(cma->bitmap);
|
||||
bitmap_free(cma->bitmap);
|
||||
cma->count = 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue