From: Palmer Dabbelt Date: Tue, 7 Apr 2020 03:08:00 +0000 (-0700) Subject: mm: prevent a warning when casting void* -> enum X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2d14ce4317e8bab6ac78145e4e3e31174811a3b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mm: prevent a warning when casting void* -> enum I recently build the RISC-V port with LLVM trunk, which has introduced a new warning when casting from a pointer to an enum of a smaller size. This patch simply casts to a long in the middle to stop the warning. I'd be surprised this is the only one in the kernel, but it's the only one I saw. Signed-off-by: Palmer Dabbelt Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/20200227211741.83165-1-palmer@dabbelt.com Signed-off-by: Linus Torvalds Change-Id: I91f127e3111aad48cbdfd2e63ab90f88047ddfca --- diff --git a/mm/rmap.c b/mm/rmap.c index 511853ed58d9..12d97f2bceaf 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1342,7 +1342,7 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, struct page *subpage; bool ret = true; unsigned long start = address, end; - enum ttu_flags flags = (enum ttu_flags)arg; + enum ttu_flags flags = (enum ttu_flags)(long)arg; /* * When racing against e.g. zap_pte_range() on another cpu,