Commit ac714904 authored by Choi Gi-yong's avatar Choi Gi-yong Committed by Linus Torvalds

mm: fix 'ERROR: do not initialise globals to 0 or NULL' and coding style

Signed-off-by: default avatarChoi Gi-yong <yong@gnoy.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent eb9a3c62
...@@ -2898,8 +2898,7 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -2898,8 +2898,7 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
if (anon_rmap) { if (anon_rmap) {
ClearPagePrivate(page); ClearPagePrivate(page);
hugepage_add_new_anon_rmap(page, vma, address); hugepage_add_new_anon_rmap(page, vma, address);
} } else
else
page_dup_rmap(page); page_dup_rmap(page);
new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE) new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE)
&& (vma->vm_flags & VM_SHARED))); && (vma->vm_flags & VM_SHARED)));
......
...@@ -298,7 +298,7 @@ long vwrite(char *buf, char *addr, unsigned long count) ...@@ -298,7 +298,7 @@ long vwrite(char *buf, char *addr, unsigned long count)
count = -(unsigned long) addr; count = -(unsigned long) addr;
memcpy(addr, buf, count); memcpy(addr, buf, count);
return(count); return count;
} }
/* /*
...@@ -1012,8 +1012,7 @@ static int validate_mmap_request(struct file *file, ...@@ -1012,8 +1012,7 @@ static int validate_mmap_request(struct file *file,
/* we mustn't privatise shared mappings */ /* we mustn't privatise shared mappings */
capabilities &= ~BDI_CAP_MAP_COPY; capabilities &= ~BDI_CAP_MAP_COPY;
} } else {
else {
/* we're going to read the file into private memory we /* we're going to read the file into private memory we
* allocate */ * allocate */
if (!(capabilities & BDI_CAP_MAP_COPY)) if (!(capabilities & BDI_CAP_MAP_COPY))
...@@ -1044,23 +1043,20 @@ static int validate_mmap_request(struct file *file, ...@@ -1044,23 +1043,20 @@ static int validate_mmap_request(struct file *file,
if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) { if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) {
if (prot & PROT_EXEC) if (prot & PROT_EXEC)
return -EPERM; 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 */ /* handle implication of PROT_EXEC by PROT_READ */
if (current->personality & READ_IMPLIES_EXEC) { if (current->personality & READ_IMPLIES_EXEC) {
if (capabilities & BDI_CAP_EXEC_MAP) if (capabilities & BDI_CAP_EXEC_MAP)
prot |= PROT_EXEC; prot |= PROT_EXEC;
} }
} } else if ((prot & PROT_READ) &&
else if ((prot & PROT_READ) &&
(prot & PROT_EXEC) && (prot & PROT_EXEC) &&
!(capabilities & BDI_CAP_EXEC_MAP) !(capabilities & BDI_CAP_EXEC_MAP)
) { ) {
/* backing file is not executable, try to copy */ /* backing file is not executable, try to copy */
capabilities &= ~BDI_CAP_MAP_DIRECT; capabilities &= ~BDI_CAP_MAP_DIRECT;
} }
} } else {
else {
/* anonymous mappings are always memory backed and can be /* anonymous mappings are always memory backed and can be
* privately mapped * privately mapped
*/ */
...@@ -1668,7 +1664,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) ...@@ -1668,7 +1664,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
/* find the first potentially overlapping VMA */ /* find the first potentially overlapping VMA */
vma = find_vma(mm, start); vma = find_vma(mm, start);
if (!vma) { if (!vma) {
static int limit = 0; static int limit;
if (limit < 5) { if (limit < 5) {
printk(KERN_WARNING printk(KERN_WARNING
"munmap of memory not mmapped by process %d" "munmap of memory not mmapped by process %d"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment