Merge tag 'llvmlinux-for-v3.15' of git://git.linuxfoundation.org/llvmlinux/kernel
[firefly-linux-kernel-4.4.55.git] / mm / nommu.c
index 5d3f3524bbdc83b7ed2eceaf6ce064c3917bba51..85f8d6698d4872c62ce3d3a03504c314b029215e 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/vmalloc.h>
 #include <linux/blkdev.h>
 #include <linux/backing-dev.h>
+#include <linux/compiler.h>
 #include <linux/mount.h>
 #include <linux/personality.h>
 #include <linux/security.h>
@@ -297,7 +298,7 @@ long vwrite(char *buf, char *addr, unsigned long count)
                count = -(unsigned long) addr;
 
        memcpy(addr, buf, count);
-       return(count);
+       return count;
 }
 
 /*
@@ -460,7 +461,7 @@ EXPORT_SYMBOL_GPL(vm_unmap_aliases);
  * Implement a stub for vmalloc_sync_all() if the architecture chose not to
  * have one.
  */
-void  __attribute__((weak)) vmalloc_sync_all(void)
+void __weak vmalloc_sync_all(void)
 {
 }
 
@@ -1011,8 +1012,7 @@ static int validate_mmap_request(struct file *file,
 
                        /* we mustn't privatise shared mappings */
                        capabilities &= ~BDI_CAP_MAP_COPY;
-               }
-               else {
+               } else {
                        /* we're going to read the file into private memory we
                         * allocate */
                        if (!(capabilities & BDI_CAP_MAP_COPY))
@@ -1043,23 +1043,20 @@ static int validate_mmap_request(struct file *file,
                if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) {
                        if (prot & PROT_EXEC)
                                return -EPERM;
-               }
-               else if ((prot & PROT_READ) && !(prot & PROT_EXEC)) {
+               } else if ((prot & PROT_READ) && !(prot & PROT_EXEC)) {
                        /* handle implication of PROT_EXEC by PROT_READ */
                        if (current->personality & READ_IMPLIES_EXEC) {
                                if (capabilities & BDI_CAP_EXEC_MAP)
                                        prot |= PROT_EXEC;
                        }
-               }
-               else if ((prot & PROT_READ) &&
+               } else if ((prot & PROT_READ) &&
                         (prot & PROT_EXEC) &&
                         !(capabilities & BDI_CAP_EXEC_MAP)
                         ) {
                        /* backing file is not executable, try to copy */
                        capabilities &= ~BDI_CAP_MAP_DIRECT;
                }
-       }
-       else {
+       } else {
                /* anonymous mappings are always memory backed and can be
                 * privately mapped
                 */
@@ -1667,7 +1664,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
        /* find the first potentially overlapping VMA */
        vma = find_vma(mm, start);
        if (!vma) {
-               static int limit = 0;
+               static int limit;
                if (limit < 5) {
                        printk(KERN_WARNING
                               "munmap of memory not mmapped by process %d"