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>
Showing
- arch/alpha/kernel/core_irongate.c 1 addition, 2 deletionsarch/alpha/kernel/core_irongate.c
- arch/mips/mm/init.c 1 addition, 1 deletionarch/mips/mm/init.c
- arch/powerpc/kernel/dt_cpu_ftrs.c 2 additions, 2 deletionsarch/powerpc/kernel/dt_cpu_ftrs.c
- arch/powerpc/kernel/setup-common.c 1 addition, 1 deletionarch/powerpc/kernel/setup-common.c
- arch/powerpc/kernel/setup_64.c 1 addition, 1 deletionarch/powerpc/kernel/setup_64.c
- arch/powerpc/platforms/powernv/pci-ioda.c 1 addition, 1 deletionarch/powerpc/platforms/powernv/pci-ioda.c
- arch/powerpc/platforms/pseries/svm.c 1 addition, 2 deletionsarch/powerpc/platforms/pseries/svm.c
- arch/riscv/kernel/setup.c 2 additions, 3 deletionsarch/riscv/kernel/setup.c
- arch/sparc/kernel/smp_64.c 1 addition, 1 deletionarch/sparc/kernel/smp_64.c
- arch/um/kernel/mem.c 1 addition, 1 deletionarch/um/kernel/mem.c
- arch/x86/kernel/setup_percpu.c 1 addition, 1 deletionarch/x86/kernel/setup_percpu.c
- arch/x86/mm/kasan_init_64.c 2 additions, 2 deletionsarch/x86/mm/kasan_init_64.c
- arch/x86/mm/numa.c 1 addition, 1 deletionarch/x86/mm/numa.c
- arch/x86/mm/numa_emulation.c 1 addition, 1 deletionarch/x86/mm/numa_emulation.c
- arch/x86/xen/mmu_pv.c 1 addition, 1 deletionarch/x86/xen/mmu_pv.c
- arch/x86/xen/p2m.c 1 addition, 1 deletionarch/x86/xen/p2m.c
- drivers/base/arch_numa.c 2 additions, 2 deletionsdrivers/base/arch_numa.c
- drivers/macintosh/smu.c 1 addition, 1 deletiondrivers/macintosh/smu.c
- drivers/xen/swiotlb-xen.c 1 addition, 1 deletiondrivers/xen/swiotlb-xen.c
- include/linux/memblock.h 1 addition, 1 deletioninclude/linux/memblock.h
Loading
Please register or sign in to comment