aboutsummaryrefslogtreecommitdiffstats
path: root/arch/riscv
diff options
context:
space:
mode:
authorMike Rapoport <rppt@linux.ibm.com>2021-11-05 13:43:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-11-06 13:30:41 -0700
commit4421cca0a3e4833b3bf0f20de98eb580ab8c7290 (patch)
tree82c77d76bbd854c45bb63746becc216d1b775fde /arch/riscv
parentmemblock: rename memblock_free to memblock_phys_free (diff)
downloadlinux-dev-4421cca0a3e4833b3bf0f20de98eb580ab8c7290.tar.xz
linux-dev-4421cca0a3e4833b3bf0f20de98eb580ab8c7290.zip
memblock: use memblock_free for freeing virtual pointers
Rename memblock_free_ptr() to memblock_free() and use memblock_free() when freeing a virtual pointer so that memblock_free() will be a counterpart of memblock_alloc() The callers are updated with the below semantic patch and manual addition of (void *) casting to pointers that are represented by unsigned long variables. @@ identifier vaddr; expression size; @@ ( - memblock_phys_free(__pa(vaddr), size); + memblock_free(vaddr, size); | - memblock_free_ptr(vaddr, size); + memblock_free(vaddr, size); ) [sfr@canb.auug.org.au: fixup] Link: https://lkml.kernel.org/r/20211018192940.3d1d532f@canb.auug.org.au Link: https://lkml.kernel.org/r/20210930185031.18648-7-rppt@kernel.org Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Juergen Gross <jgross@suse.com> Cc: Shahab Vahedi <Shahab.Vahedi@synopsys.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/kernel/setup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 6ea7c53b82cd..b42bfdc67482 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -230,14 +230,13 @@ static void __init init_resources(void)
/* Clean-up any unused pre-allocated resources */
if (res_idx >= 0)
- memblock_phys_free(__pa(mem_res),
- (res_idx + 1) * sizeof(*mem_res));
+ memblock_free(mem_res, (res_idx + 1) * sizeof(*mem_res));
return;
error:
/* Better an empty resource tree than an inconsistent one */
release_child_resources(&iomem_resource);
- memblock_phys_free(__pa(mem_res), mem_res_sz);
+ memblock_free(mem_res, mem_res_sz);
}