aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo F. Padovan <gustavo@las.ic.unicamp.br>2008-07-29 01:48:56 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-31 12:21:33 -0400
commite9c8abb66cc37801bdb5d4360bb78d180c3bbb73 (patch)
treef8350638c286c97b5570d621640cb59c9bae9d12
parent4df9e510a9fda29aca71d8acac853b98aa6884d1 (diff)
x86: coding style fixes to arch/x86/kernel/sys_x86_64.c
Fix all errors and many warnings reported by checkpatch.pl without change sys_x86_64.o arch/x86/kernel/sys_x86_64.o: text data bss dec hex filename 1567 0 0 1567 61f sys_x86_64.o.after 1567 0 0 1567 61f sys_x86_64.o.before md5: de28ffedcb5851dfd7ec87a03afec1fd sys_x86_64.o.after de28ffedcb5851dfd7ec87a03afec1fd sys_x86_64.o.before Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/sys_x86_64.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index 3b360ef33817..56eb8f916e9f 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -13,15 +13,16 @@
13#include <linux/utsname.h> 13#include <linux/utsname.h>
14#include <linux/personality.h> 14#include <linux/personality.h>
15#include <linux/random.h> 15#include <linux/random.h>
16#include <linux/uaccess.h>
16 17
17#include <asm/uaccess.h>
18#include <asm/ia32.h> 18#include <asm/ia32.h>
19 19
20asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, 20asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
21 unsigned long fd, unsigned long off) 21 unsigned long prot, unsigned long flags,
22 unsigned long fd, unsigned long off)
22{ 23{
23 long error; 24 long error;
24 struct file * file; 25 struct file *file;
25 26
26 error = -EINVAL; 27 error = -EINVAL;
27 if (off & ~PAGE_MASK) 28 if (off & ~PAGE_MASK)
@@ -56,9 +57,9 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
56 unmapped base down for this case. This can give 57 unmapped base down for this case. This can give
57 conflicts with the heap, but we assume that glibc 58 conflicts with the heap, but we assume that glibc
58 malloc knows how to fall back to mmap. Give it 1GB 59 malloc knows how to fall back to mmap. Give it 1GB
59 of playground for now. -AK */ 60 of playground for now. -AK */
60 *begin = 0x40000000; 61 *begin = 0x40000000;
61 *end = 0x80000000; 62 *end = 0x80000000;
62 if (current->flags & PF_RANDOMIZE) { 63 if (current->flags & PF_RANDOMIZE) {
63 new_begin = randomize_range(*begin, *begin + 0x02000000, 0); 64 new_begin = randomize_range(*begin, *begin + 0x02000000, 0);
64 if (new_begin) 65 if (new_begin)
@@ -66,9 +67,9 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
66 } 67 }
67 } else { 68 } else {
68 *begin = TASK_UNMAPPED_BASE; 69 *begin = TASK_UNMAPPED_BASE;
69 *end = TASK_SIZE; 70 *end = TASK_SIZE;
70 } 71 }
71} 72}
72 73
73unsigned long 74unsigned long
74arch_get_unmapped_area(struct file *filp, unsigned long addr, 75arch_get_unmapped_area(struct file *filp, unsigned long addr,
@@ -78,11 +79,11 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
78 struct vm_area_struct *vma; 79 struct vm_area_struct *vma;
79 unsigned long start_addr; 80 unsigned long start_addr;
80 unsigned long begin, end; 81 unsigned long begin, end;
81 82
82 if (flags & MAP_FIXED) 83 if (flags & MAP_FIXED)
83 return addr; 84 return addr;
84 85
85 find_start_end(flags, &begin, &end); 86 find_start_end(flags, &begin, &end);
86 87
87 if (len > end) 88 if (len > end)
88 return -ENOMEM; 89 return -ENOMEM;
@@ -96,12 +97,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
96 } 97 }
97 if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32)) 98 if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32))
98 && len <= mm->cached_hole_size) { 99 && len <= mm->cached_hole_size) {
99 mm->cached_hole_size = 0; 100 mm->cached_hole_size = 0;
100 mm->free_area_cache = begin; 101 mm->free_area_cache = begin;
101 } 102 }
102 addr = mm->free_area_cache; 103 addr = mm->free_area_cache;
103 if (addr < begin) 104 if (addr < begin)
104 addr = begin; 105 addr = begin;
105 start_addr = addr; 106 start_addr = addr;
106 107
107full_search: 108full_search:
@@ -127,7 +128,7 @@ full_search:
127 return addr; 128 return addr;
128 } 129 }
129 if (addr + mm->cached_hole_size < vma->vm_start) 130 if (addr + mm->cached_hole_size < vma->vm_start)
130 mm->cached_hole_size = vma->vm_start - addr; 131 mm->cached_hole_size = vma->vm_start - addr;
131 132
132 addr = vma->vm_end; 133 addr = vma->vm_end;
133 } 134 }
@@ -177,7 +178,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
177 vma = find_vma(mm, addr-len); 178 vma = find_vma(mm, addr-len);
178 if (!vma || addr <= vma->vm_start) 179 if (!vma || addr <= vma->vm_start)
179 /* remember the address as a hint for next time */ 180 /* remember the address as a hint for next time */
180 return (mm->free_area_cache = addr-len); 181 return mm->free_area_cache = addr-len;
181 } 182 }
182 183
183 if (mm->mmap_base < len) 184 if (mm->mmap_base < len)
@@ -194,7 +195,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
194 vma = find_vma(mm, addr); 195 vma = find_vma(mm, addr);
195 if (!vma || addr+len <= vma->vm_start) 196 if (!vma || addr+len <= vma->vm_start)
196 /* remember the address as a hint for next time */ 197 /* remember the address as a hint for next time */
197 return (mm->free_area_cache = addr); 198 return mm->free_area_cache = addr;
198 199
199 /* remember the largest hole we saw so far */ 200 /* remember the largest hole we saw so far */
200 if (addr + mm->cached_hole_size < vma->vm_start) 201 if (addr + mm->cached_hole_size < vma->vm_start)
@@ -224,13 +225,13 @@ bottomup:
224} 225}
225 226
226 227
227asmlinkage long sys_uname(struct new_utsname __user * name) 228asmlinkage long sys_uname(struct new_utsname __user *name)
228{ 229{
229 int err; 230 int err;
230 down_read(&uts_sem); 231 down_read(&uts_sem);
231 err = copy_to_user(name, utsname(), sizeof (*name)); 232 err = copy_to_user(name, utsname(), sizeof(*name));
232 up_read(&uts_sem); 233 up_read(&uts_sem);
233 if (personality(current->personality) == PER_LINUX32) 234 if (personality(current->personality) == PER_LINUX32)
234 err |= copy_to_user(&name->machine, "i686", 5); 235 err |= copy_to_user(&name->machine, "i686", 5);
235 return err ? -EFAULT : 0; 236 return err ? -EFAULT : 0;
236} 237}