Skip to content

Commit

Permalink
mm: fix 'ERROR: do not initialise globals to 0 or NULL' and coding style
Browse files Browse the repository at this point in the history
Signed-off-by: Choi Gi-yong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Choi Gi-yong authored and torvalds committed Apr 7, 2014
1 parent eb9a3c6 commit ac71490
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
3 changes: 1 addition & 2 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2898,8 +2898,7 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
if (anon_rmap) {
ClearPagePrivate(page);
hugepage_add_new_anon_rmap(page, vma, address);
}
else
} else
page_dup_rmap(page);
new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE)
&& (vma->vm_flags & VM_SHARED)));
Expand Down
16 changes: 6 additions & 10 deletions mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ long vwrite(char *buf, char *addr, unsigned long count)
count = -(unsigned long) addr;

memcpy(addr, buf, count);
return(count);
return count;
}

/*
Expand Down Expand Up @@ -1012,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))
Expand Down Expand Up @@ -1044,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
*/
Expand Down Expand Up @@ -1668,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"
Expand Down

0 comments on commit ac71490

Please sign in to comment.