[PATCH v3 3/6] mm/vmalloc: constify vm parameter of get_vm_area_page_order()
Mike Rapoport (Microsoft)
rppt at kernel.org
Thu Sep 3 02:28:29 PDT 2026
get_vm_area_page_order() and vm_area_page_order() do not need to modify
struct vm_struct passed to them.
Constify the parameter.
Reviewed-by: Uladzislau Rezki (Sony) <urezki at gmail.com>
Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
---
mm/vmalloc.c | 4 ++--
mm/vmalloc.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 22aa554d123f5..5506b180f5c27 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3130,7 +3130,7 @@ EXPORT_SYMBOL(vm_map_ram);
static struct vm_struct *vmlist __initdata;
-static inline unsigned int vm_area_page_order(struct vm_struct *vm)
+static inline unsigned int vm_area_page_order(const struct vm_struct *vm)
{
#ifdef CONFIG_HAVE_ARCH_HUGE_VMALLOC
return vm->page_order;
@@ -3139,7 +3139,7 @@ static inline unsigned int vm_area_page_order(struct vm_struct *vm)
#endif
}
-unsigned int get_vm_area_page_order(struct vm_struct *vm)
+unsigned int get_vm_area_page_order(const struct vm_struct *vm)
{
return vm_area_page_order(vm);
}
diff --git a/mm/vmalloc.h b/mm/vmalloc.h
index 8866ddcff6681..211869f365095 100644
--- a/mm/vmalloc.h
+++ b/mm/vmalloc.h
@@ -12,7 +12,7 @@ void __init vmalloc_init(void);
int __must_check vmap_pages_range_noflush(unsigned long addr, unsigned long end,
pgprot_t prot, struct page **pages,
unsigned int page_shift, gfp_t gfp_mask);
-unsigned int get_vm_area_page_order(struct vm_struct *vm);
+unsigned int get_vm_area_page_order(const struct vm_struct *vm);
#else
static inline void vmalloc_init(void) {}
--
2.53.0
More information about the linux-arm-kernel
mailing list