summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/hugetlb.h
diff options
context:
space:
mode:
authorOscar Salvador <osalvador@suse.de>2024-10-07 09:50:37 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-11-07 05:11:10 +0100
commitbd40b053fabe27209cb240d205a0c817cbe5fb87 (patch)
treef642ad79ff45513e4ae7c9494c0889c3ad1eb8f4 /include/asm-generic/hugetlb.h
parentarch/s390: clean up hugetlb definitions (diff)
downloadlinux-bd40b053fabe27209cb240d205a0c817cbe5fb87.tar.xz
linux-bd40b053fabe27209cb240d205a0c817cbe5fb87.zip
mm: consolidate common checks in hugetlb_get_unmapped_area
prepare_hugepage_range() performs almost the same checks for all architectures that define it, with the exception of mips and loongarch that also check for overflows. The rest checks for the addr and len to be properly aligned, so we can move that to hugetlb_get_unmapped_area() and get rid of a fair amount of duplicated code. [akpm@linux-foundation.org: remove now-unused local] Link: https://lore.kernel.org/oe-kbuild-all/202410081210.uNLbf3Jk-lkp@intel.com/ Link: https://lkml.kernel.org/r/20241007075037.267650-10-osalvador@suse.de Signed-off-by: Oscar Salvador <osalvador@suse.de> Cc: David Hildenbrand <david@redhat.com> Cc: Donet Tom <donettom@linux.ibm.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Muchun Song <muchun.song@linux.dev> Cc: Peter Xu <peterx@redhat.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/hugetlb.h')
-rw-r--r--include/asm-generic/hugetlb.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
index 67bbdafcfc22..f42133dae68e 100644
--- a/include/asm-generic/hugetlb.h
+++ b/include/asm-generic/hugetlb.h
@@ -123,13 +123,6 @@ static inline int huge_pte_none_mostly(pte_t pte)
static inline int prepare_hugepage_range(struct file *file,
unsigned long addr, unsigned long len)
{
- struct hstate *h = hstate_file(file);
-
- if (len & ~huge_page_mask(h))
- return -EINVAL;
- if (addr & ~huge_page_mask(h))
- return -EINVAL;
-
return 0;
}
#endif