]> Git Repo - linux.git/blobdiff - mm/mseal.c
Merge tag 'imx-fixes-6.11' of https://git.kernel.org/pub/scm/linux/kernel/git/shawngu...
[linux.git] / mm / mseal.c
index bf783bba8ed0b92ba80fac5b3459d9bfe0ceb4b4..15bba28acc005fdd8725f4dda8937bbf364433c2 100644 (file)
@@ -40,9 +40,17 @@ static bool can_modify_vma(struct vm_area_struct *vma)
 
 static bool is_madv_discard(int behavior)
 {
-       return  behavior &
-               (MADV_FREE | MADV_DONTNEED | MADV_DONTNEED_LOCKED |
-                MADV_REMOVE | MADV_DONTFORK | MADV_WIPEONFORK);
+       switch (behavior) {
+       case MADV_FREE:
+       case MADV_DONTNEED:
+       case MADV_DONTNEED_LOCKED:
+       case MADV_REMOVE:
+       case MADV_DONTFORK:
+       case MADV_WIPEONFORK:
+               return true;
+       }
+
+       return false;
 }
 
 static bool is_ro_anon(struct vm_area_struct *vma)
This page took 0.033556 seconds and 4 git commands to generate.