Commit 1faa6343 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Fix -Wdeclaration-after-statement warnings for x86-64

Fix warnings on compilers that support -Wdeclaration-after-statement
in the x86-64 specific code. x86-64 was happily using ISO-C99 code
before because it only uses gcc 3+ which is ISO-C99 compliant, but
unfortunately this warning was added in the top level Makefile.

From Bryan O'Sullivan.
parent 9df138cf
...@@ -1952,6 +1952,9 @@ long ...@@ -1952,6 +1952,9 @@ long
sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id) sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id)
{ {
struct sigevent se; struct sigevent se;
mm_segment_t oldfs;
long err;
if (se32) { if (se32) {
memset(&se, 0, sizeof(struct sigevent)); memset(&se, 0, sizeof(struct sigevent));
if (get_user(se.sigev_value.sival_int, &se32->sigev_value) || if (get_user(se.sigev_value.sival_int, &se32->sigev_value) ||
...@@ -1964,9 +1967,9 @@ sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id) ...@@ -1964,9 +1967,9 @@ sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id)
if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t))) if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t)))
return -EFAULT; return -EFAULT;
mm_segment_t oldfs = get_fs(); oldfs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
long err = sys_timer_create(clock, se32 ? &se : NULL, timer_id); err = sys_timer_create(clock, se32 ? &se : NULL, timer_id);
set_fs(oldfs); set_fs(oldfs);
return err; return err;
......
...@@ -355,9 +355,10 @@ void __init clear_kernel_mapping(unsigned long address, unsigned long size) ...@@ -355,9 +355,10 @@ void __init clear_kernel_mapping(unsigned long address, unsigned long size)
for (; address < end; address += LARGE_PAGE_SIZE) { for (; address < end; address += LARGE_PAGE_SIZE) {
pgd_t *pgd = pgd_offset_k(address); pgd_t *pgd = pgd_offset_k(address);
pmd_t *pmd;
if (!pgd || pgd_none(*pgd)) if (!pgd || pgd_none(*pgd))
continue; continue;
pmd_t *pmd = pmd_offset(pgd, address); pmd = pmd_offset(pgd, address);
if (!pmd || pmd_none(*pmd)) if (!pmd || pmd_none(*pmd))
continue; continue;
if (0 == (pmd_val(*pmd) & _PAGE_PSE)) { if (0 == (pmd_val(*pmd) & _PAGE_PSE)) {
...@@ -513,24 +514,29 @@ void __init reserve_bootmem_generic(unsigned long phys, unsigned len) ...@@ -513,24 +514,29 @@ void __init reserve_bootmem_generic(unsigned long phys, unsigned len)
int kern_addr_valid(unsigned long addr) int kern_addr_valid(unsigned long addr)
{ {
unsigned long above = ((long)addr) >> __VIRTUAL_MASK_SHIFT; unsigned long above = ((long)addr) >> __VIRTUAL_MASK_SHIFT;
pml4_t *pml4;
pgd_t *pgd;
pmd_t *pmd;
pte_t *pte;
if (above != 0 && above != -1UL) if (above != 0 && above != -1UL)
return 0; return 0;
pml4_t *pml4 = pml4_offset_k(addr); pml4 = pml4_offset_k(addr);
if (pml4_none(*pml4)) if (pml4_none(*pml4))
return 0; return 0;
pgd_t *pgd = pgd_offset_k(addr); pgd = pgd_offset_k(addr);
if (pgd_none(*pgd)) if (pgd_none(*pgd))
return 0; return 0;
pmd_t *pmd = pmd_offset(pgd, addr); pmd = pmd_offset(pgd, addr);
if (pmd_none(*pmd)) if (pmd_none(*pmd))
return 0; return 0;
if (pmd_large(*pmd)) if (pmd_large(*pmd))
return pfn_valid(pmd_pfn(*pmd)); return pfn_valid(pmd_pfn(*pmd));
pte_t *pte = pte_offset_kernel(pmd, addr); pte = pte_offset_kernel(pmd, addr);
if (pte_none(*pte)) if (pte_none(*pte))
return 0; return 0;
return pfn_valid(pte_pfn(*pte)); return pfn_valid(pte_pfn(*pte));
......
...@@ -241,9 +241,9 @@ extern unsigned long copy_in_user(void *to, const void *from, unsigned len); ...@@ -241,9 +241,9 @@ extern unsigned long copy_in_user(void *to, const void *from, unsigned len);
static inline int __copy_from_user(void *dst, const void *src, unsigned size) static inline int __copy_from_user(void *dst, const void *src, unsigned size)
{ {
int ret = 0;
if (!__builtin_constant_p(size)) if (!__builtin_constant_p(size))
return copy_user_generic(dst,src,size); return copy_user_generic(dst,src,size);
int ret = 0;
switch (size) { switch (size) {
case 1:__get_user_asm(*(u8*)dst,(u8 *)src,ret,"b","b","=q",1); case 1:__get_user_asm(*(u8*)dst,(u8 *)src,ret,"b","b","=q",1);
return ret; return ret;
...@@ -270,9 +270,9 @@ static inline int __copy_from_user(void *dst, const void *src, unsigned size) ...@@ -270,9 +270,9 @@ static inline int __copy_from_user(void *dst, const void *src, unsigned size)
static inline int __copy_to_user(void *dst, const void *src, unsigned size) static inline int __copy_to_user(void *dst, const void *src, unsigned size)
{ {
int ret = 0;
if (!__builtin_constant_p(size)) if (!__builtin_constant_p(size))
return copy_user_generic(dst,src,size); return copy_user_generic(dst,src,size);
int ret = 0;
switch (size) { switch (size) {
case 1:__put_user_asm(*(u8*)src,(u8 *)dst,ret,"b","b","iq",1); case 1:__put_user_asm(*(u8*)src,(u8 *)dst,ret,"b","b","iq",1);
return ret; return ret;
...@@ -302,9 +302,9 @@ static inline int __copy_to_user(void *dst, const void *src, unsigned size) ...@@ -302,9 +302,9 @@ static inline int __copy_to_user(void *dst, const void *src, unsigned size)
static inline int __copy_in_user(void *dst, const void *src, unsigned size) static inline int __copy_in_user(void *dst, const void *src, unsigned size)
{ {
int ret = 0;
if (!__builtin_constant_p(size)) if (!__builtin_constant_p(size))
return copy_user_generic(dst,src,size); return copy_user_generic(dst,src,size);
int ret = 0;
switch (size) { switch (size) {
case 1: { case 1: {
u8 tmp; u8 tmp;
......
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