mm: rmap: Fix invalid casting from a void to an enumerator.
authorJyotiraditya Panda <jyotiraditya@aospa.co>
Tue, 12 Oct 2021 17:51:03 +0000 (17:51 +0000)
committerivanmeler <i_ivan@windowslive.com>
Tue, 29 Mar 2022 17:55:16 +0000 (17:55 +0000)
 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

index fda3e3f4dc2a1662a981273636a611c726ae925f..d4fd01e7aa9fd9d3f3f745d2af9899541956796a 100644 (file)
--- 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))