diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-05-26 06:16:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-26 12:20:31 -0400 |
commit | ca16d140af91febe25daeb9e032bf8bd46b8c31f (patch) | |
tree | a093c3f244a1bdfc2a50e271a7e6df3324df0f05 /mm/mmap.c | |
parent | 4db70f73e56961b9bcdfd0c36c62847a18b7dbb5 (diff) |
mm: don't access vm_flags as 'int'
The type of vma->vm_flags is 'unsigned long'. Neither 'int' nor
'unsigned int'. This patch fixes such misuse.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
[ Changed to use a typedef - we'll extend it to cover more cases
later, since there has been discussion about making it a 64-bit
type.. - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -960,7 +960,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |||
960 | { | 960 | { |
961 | struct mm_struct * mm = current->mm; | 961 | struct mm_struct * mm = current->mm; |
962 | struct inode *inode; | 962 | struct inode *inode; |
963 | unsigned int vm_flags; | 963 | vm_flags_t vm_flags; |
964 | int error; | 964 | int error; |
965 | unsigned long reqprot = prot; | 965 | unsigned long reqprot = prot; |
966 | 966 | ||
@@ -1165,7 +1165,7 @@ SYSCALL_DEFINE1(old_mmap, struct mmap_arg_struct __user *, arg) | |||
1165 | */ | 1165 | */ |
1166 | int vma_wants_writenotify(struct vm_area_struct *vma) | 1166 | int vma_wants_writenotify(struct vm_area_struct *vma) |
1167 | { | 1167 | { |
1168 | unsigned int vm_flags = vma->vm_flags; | 1168 | vm_flags_t vm_flags = vma->vm_flags; |
1169 | 1169 | ||
1170 | /* If it was private or non-writable, the write bit is already clear */ | 1170 | /* If it was private or non-writable, the write bit is already clear */ |
1171 | if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED))) | 1171 | if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED))) |
@@ -1193,7 +1193,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma) | |||
1193 | * We account for memory if it's a private writeable mapping, | 1193 | * We account for memory if it's a private writeable mapping, |
1194 | * not hugepages and VM_NORESERVE wasn't set. | 1194 | * not hugepages and VM_NORESERVE wasn't set. |
1195 | */ | 1195 | */ |
1196 | static inline int accountable_mapping(struct file *file, unsigned int vm_flags) | 1196 | static inline int accountable_mapping(struct file *file, vm_flags_t vm_flags) |
1197 | { | 1197 | { |
1198 | /* | 1198 | /* |
1199 | * hugetlb has its own accounting separate from the core VM | 1199 | * hugetlb has its own accounting separate from the core VM |
@@ -1207,7 +1207,7 @@ static inline int accountable_mapping(struct file *file, unsigned int vm_flags) | |||
1207 | 1207 | ||
1208 | unsigned long mmap_region(struct file *file, unsigned long addr, | 1208 | unsigned long mmap_region(struct file *file, unsigned long addr, |
1209 | unsigned long len, unsigned long flags, | 1209 | unsigned long len, unsigned long flags, |
1210 | unsigned int vm_flags, unsigned long pgoff) | 1210 | vm_flags_t vm_flags, unsigned long pgoff) |
1211 | { | 1211 | { |
1212 | struct mm_struct *mm = current->mm; | 1212 | struct mm_struct *mm = current->mm; |
1213 | struct vm_area_struct *vma, *prev; | 1213 | struct vm_area_struct *vma, *prev; |