From 7d423a811febc9596eea40d937119498ee0f3b23 Mon Sep 17 00:00:00 2001 From: Jyotiraditya Panda Date: Tue, 12 Oct 2021 17:51:03 +0000 Subject: [PATCH] mm: rmap: Fix invalid casting from a void to an enumerator. fixes: ../mm/rmap.c:1344:25: warning: cast to smaller integer type 'enum ttu_flags' from 'void *' [-Wvoid-pointer-to-enum-cast] enum ttu_flags flags = (enum ttu_flags)arg; ^~~~~~~~~~~~~~~~~~~ --- mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/rmap.c b/mm/rmap.c index fda3e3f4dc2a..d4fd01e7aa9f 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1327,7 +1327,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, pte_t pteval; spinlock_t *ptl; int ret = SWAP_AGAIN; - enum ttu_flags flags = (enum ttu_flags)arg; + enum ttu_flags flags = (enum ttu_flags)(long)arg; /* munlock has nothing to gain from examining un-locked vmas */ if ((flags & TTU_MUNLOCK) && !(vma->vm_flags & VM_LOCKED)) -- 2.20.1