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>
This commit is contained in:
parent
4df9e510a9
commit
e9c8abb66c
1 changed files with 22 additions and 21 deletions
|
@ -13,15 +13,16 @@
|
||||||
#include <linux/utsname.h>
|
#include <linux/utsname.h>
|
||||||
#include <linux/personality.h>
|
#include <linux/personality.h>
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
#include <asm/uaccess.h>
|
|
||||||
#include <asm/ia32.h>
|
#include <asm/ia32.h>
|
||||||
|
|
||||||
asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags,
|
asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
|
||||||
unsigned long fd, unsigned long off)
|
unsigned long prot, unsigned long flags,
|
||||||
|
unsigned long fd, unsigned long off)
|
||||||
{
|
{
|
||||||
long error;
|
long error;
|
||||||
struct file * file;
|
struct file *file;
|
||||||
|
|
||||||
error = -EINVAL;
|
error = -EINVAL;
|
||||||
if (off & ~PAGE_MASK)
|
if (off & ~PAGE_MASK)
|
||||||
|
@ -56,9 +57,9 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
|
||||||
unmapped base down for this case. This can give
|
unmapped base down for this case. This can give
|
||||||
conflicts with the heap, but we assume that glibc
|
conflicts with the heap, but we assume that glibc
|
||||||
malloc knows how to fall back to mmap. Give it 1GB
|
malloc knows how to fall back to mmap. Give it 1GB
|
||||||
of playground for now. -AK */
|
of playground for now. -AK */
|
||||||
*begin = 0x40000000;
|
*begin = 0x40000000;
|
||||||
*end = 0x80000000;
|
*end = 0x80000000;
|
||||||
if (current->flags & PF_RANDOMIZE) {
|
if (current->flags & PF_RANDOMIZE) {
|
||||||
new_begin = randomize_range(*begin, *begin + 0x02000000, 0);
|
new_begin = randomize_range(*begin, *begin + 0x02000000, 0);
|
||||||
if (new_begin)
|
if (new_begin)
|
||||||
|
@ -66,9 +67,9 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
*begin = TASK_UNMAPPED_BASE;
|
*begin = TASK_UNMAPPED_BASE;
|
||||||
*end = TASK_SIZE;
|
*end = TASK_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
arch_get_unmapped_area(struct file *filp, unsigned long addr,
|
arch_get_unmapped_area(struct file *filp, unsigned long addr,
|
||||||
|
@ -78,11 +79,11 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
|
||||||
struct vm_area_struct *vma;
|
struct vm_area_struct *vma;
|
||||||
unsigned long start_addr;
|
unsigned long start_addr;
|
||||||
unsigned long begin, end;
|
unsigned long begin, end;
|
||||||
|
|
||||||
if (flags & MAP_FIXED)
|
if (flags & MAP_FIXED)
|
||||||
return addr;
|
return addr;
|
||||||
|
|
||||||
find_start_end(flags, &begin, &end);
|
find_start_end(flags, &begin, &end);
|
||||||
|
|
||||||
if (len > end)
|
if (len > end)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -96,12 +97,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
|
||||||
}
|
}
|
||||||
if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32))
|
if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32))
|
||||||
&& len <= mm->cached_hole_size) {
|
&& len <= mm->cached_hole_size) {
|
||||||
mm->cached_hole_size = 0;
|
mm->cached_hole_size = 0;
|
||||||
mm->free_area_cache = begin;
|
mm->free_area_cache = begin;
|
||||||
}
|
}
|
||||||
addr = mm->free_area_cache;
|
addr = mm->free_area_cache;
|
||||||
if (addr < begin)
|
if (addr < begin)
|
||||||
addr = begin;
|
addr = begin;
|
||||||
start_addr = addr;
|
start_addr = addr;
|
||||||
|
|
||||||
full_search:
|
full_search:
|
||||||
|
@ -127,7 +128,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
if (addr + mm->cached_hole_size < vma->vm_start)
|
if (addr + mm->cached_hole_size < vma->vm_start)
|
||||||
mm->cached_hole_size = vma->vm_start - addr;
|
mm->cached_hole_size = vma->vm_start - addr;
|
||||||
|
|
||||||
addr = vma->vm_end;
|
addr = vma->vm_end;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +178,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
|
||||||
vma = find_vma(mm, addr-len);
|
vma = find_vma(mm, addr-len);
|
||||||
if (!vma || addr <= vma->vm_start)
|
if (!vma || addr <= vma->vm_start)
|
||||||
/* remember the address as a hint for next time */
|
/* remember the address as a hint for next time */
|
||||||
return (mm->free_area_cache = addr-len);
|
return mm->free_area_cache = addr-len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mm->mmap_base < len)
|
if (mm->mmap_base < len)
|
||||||
|
@ -194,7 +195,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
|
||||||
vma = find_vma(mm, addr);
|
vma = find_vma(mm, addr);
|
||||||
if (!vma || addr+len <= vma->vm_start)
|
if (!vma || addr+len <= vma->vm_start)
|
||||||
/* remember the address as a hint for next time */
|
/* remember the address as a hint for next time */
|
||||||
return (mm->free_area_cache = addr);
|
return mm->free_area_cache = addr;
|
||||||
|
|
||||||
/* remember the largest hole we saw so far */
|
/* remember the largest hole we saw so far */
|
||||||
if (addr + mm->cached_hole_size < vma->vm_start)
|
if (addr + mm->cached_hole_size < vma->vm_start)
|
||||||
|
@ -224,13 +225,13 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
asmlinkage long sys_uname(struct new_utsname __user * name)
|
asmlinkage long sys_uname(struct new_utsname __user *name)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
down_read(&uts_sem);
|
down_read(&uts_sem);
|
||||||
err = copy_to_user(name, utsname(), sizeof (*name));
|
err = copy_to_user(name, utsname(), sizeof(*name));
|
||||||
up_read(&uts_sem);
|
up_read(&uts_sem);
|
||||||
if (personality(current->personality) == PER_LINUX32)
|
if (personality(current->personality) == PER_LINUX32)
|
||||||
err |= copy_to_user(&name->machine, "i686", 5);
|
err |= copy_to_user(&name->machine, "i686", 5);
|
||||||
return err ? -EFAULT : 0;
|
return err ? -EFAULT : 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue