aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChoi Gi-yong <yong@gnoy.org>2014-04-07 18:37:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:35:55 -0400
commitac7149045d9fcca1063e22e4c6f607bca8fce268 (patch)
tree14fa8b9046ff613628dc85920fb7b250b5bfdcad /mm
parenteb9a3c62a0b6064c7f7e5b961ce00c646d21cb78 (diff)
mm: fix 'ERROR: do not initialise globals to 0 or NULL' and coding style
Signed-off-by: Choi Gi-yong <yong@gnoy.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/hugetlb.c3
-rw-r--r--mm/nommu.c16
2 files changed, 7 insertions, 12 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c5aa43993364..27938c441b6f 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2898,8 +2898,7 @@ retry:
2898 if (anon_rmap) { 2898 if (anon_rmap) {
2899 ClearPagePrivate(page); 2899 ClearPagePrivate(page);
2900 hugepage_add_new_anon_rmap(page, vma, address); 2900 hugepage_add_new_anon_rmap(page, vma, address);
2901 } 2901 } else
2902 else
2903 page_dup_rmap(page); 2902 page_dup_rmap(page);
2904 new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE) 2903 new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE)
2905 && (vma->vm_flags & VM_SHARED))); 2904 && (vma->vm_flags & VM_SHARED)));
diff --git a/mm/nommu.c b/mm/nommu.c
index e68deff6d447..85f8d6698d48 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -298,7 +298,7 @@ long vwrite(char *buf, char *addr, unsigned long count)
298 count = -(unsigned long) addr; 298 count = -(unsigned long) addr;
299 299
300 memcpy(addr, buf, count); 300 memcpy(addr, buf, count);
301 return(count); 301 return count;
302} 302}
303 303
304/* 304/*
@@ -1012,8 +1012,7 @@ static int validate_mmap_request(struct file *file,
1012 1012
1013 /* we mustn't privatise shared mappings */ 1013 /* we mustn't privatise shared mappings */
1014 capabilities &= ~BDI_CAP_MAP_COPY; 1014 capabilities &= ~BDI_CAP_MAP_COPY;
1015 } 1015 } else {
1016 else {
1017 /* we're going to read the file into private memory we 1016 /* we're going to read the file into private memory we
1018 * allocate */ 1017 * allocate */
1019 if (!(capabilities & BDI_CAP_MAP_COPY)) 1018 if (!(capabilities & BDI_CAP_MAP_COPY))
@@ -1044,23 +1043,20 @@ static int validate_mmap_request(struct file *file,
1044 if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) { 1043 if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) {
1045 if (prot & PROT_EXEC) 1044 if (prot & PROT_EXEC)
1046 return -EPERM; 1045 return -EPERM;
1047 } 1046 } else if ((prot & PROT_READ) && !(prot & PROT_EXEC)) {
1048 else if ((prot & PROT_READ) && !(prot & PROT_EXEC)) {
1049 /* handle implication of PROT_EXEC by PROT_READ */ 1047 /* handle implication of PROT_EXEC by PROT_READ */
1050 if (current->personality & READ_IMPLIES_EXEC) { 1048 if (current->personality & READ_IMPLIES_EXEC) {
1051 if (capabilities & BDI_CAP_EXEC_MAP) 1049 if (capabilities & BDI_CAP_EXEC_MAP)
1052 prot |= PROT_EXEC; 1050 prot |= PROT_EXEC;
1053 } 1051 }
1054 } 1052 } else if ((prot & PROT_READ) &&
1055 else if ((prot & PROT_READ) &&
1056 (prot & PROT_EXEC) && 1053 (prot & PROT_EXEC) &&
1057 !(capabilities & BDI_CAP_EXEC_MAP) 1054 !(capabilities & BDI_CAP_EXEC_MAP)
1058 ) { 1055 ) {
1059 /* backing file is not executable, try to copy */ 1056 /* backing file is not executable, try to copy */
1060 capabilities &= ~BDI_CAP_MAP_DIRECT; 1057 capabilities &= ~BDI_CAP_MAP_DIRECT;
1061 } 1058 }
1062 } 1059 } else {
1063 else {
1064 /* anonymous mappings are always memory backed and can be 1060 /* anonymous mappings are always memory backed and can be
1065 * privately mapped 1061 * privately mapped
1066 */ 1062 */
@@ -1668,7 +1664,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
1668 /* find the first potentially overlapping VMA */ 1664 /* find the first potentially overlapping VMA */
1669 vma = find_vma(mm, start); 1665 vma = find_vma(mm, start);
1670 if (!vma) { 1666 if (!vma) {
1671 static int limit = 0; 1667 static int limit;
1672 if (limit < 5) { 1668 if (limit < 5) {
1673 printk(KERN_WARNING 1669 printk(KERN_WARNING
1674 "munmap of memory not mmapped by process %d" 1670 "munmap of memory not mmapped by process %d"