Commit bf434bf2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] gcc-3.4.0 fixes for 2.6.6-rc3 x86_64 kernel

From: Mikael Pettersson <mikpe@csd.uu.se>

Here are some patches to fix compilation warnings from
gcc-3.4.0 in the 2.6.6-rc3 x86_64 kernel.

- puts() type conflict in boot/compressed/misc.c:
  rename to putstr(), just like i386 did
- cast-as-lvalue in ia32_copy_siginfo_from_user():
  use temporary
- code before declaration in io_apic.c:
  move decl up
- code before declaration in ioremap.c:
  move existing #ifndef up
- cast-as-lvalue (tons of them) from UP version of per_cpu():
  merged asm-generic's version
parent 0b4e162c
......@@ -92,7 +92,7 @@ static unsigned long output_ptr = 0;
static void *malloc(int size);
static void free(void *where);
static void puts(const char *);
static void putstr(const char *);
extern int end;
static long free_mem_ptr = (long)&end;
......@@ -153,7 +153,7 @@ static void scroll(void)
vidmem[i] = ' ';
}
static void puts(const char *s)
static void putstr(const char *s)
{
int x,y,pos;
char c;
......@@ -270,9 +270,9 @@ static void flush_window(void)
static void error(char *x)
{
puts("\n\n");
puts(x);
puts("\n\n -- System halted");
putstr("\n\n");
putstr(x);
putstr("\n\n -- System halted");
while(1);
}
......@@ -346,9 +346,9 @@ int decompress_kernel(struct moveparams *mv, void *rmode)
else setup_output_buffer_if_we_run_high(mv);
makecrc();
puts(".\nDecompressing Linux...");
putstr(".\nDecompressing Linux...");
gunzip();
puts("done.\nBooting the kernel.\n");
putstr("done.\nBooting the kernel.\n");
if (high_loaded) close_output_buffer_if_we_run_high(mv);
return high_loaded;
}
......@@ -98,6 +98,7 @@ int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from)
int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from)
{
int err;
u32 ptr32;
if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32)))
return -EFAULT;
......@@ -107,7 +108,8 @@ int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from)
err |= __get_user(to->si_pid, &from->si_pid);
err |= __get_user(to->si_uid, &from->si_uid);
err |= __get_user((u32)(u64)to->si_ptr, &from->si_ptr);
err |= __get_user(ptr32, &from->si_ptr);
to->si_ptr = (void*)(u64)ptr32;
return err;
}
......
......@@ -237,6 +237,7 @@ void __init check_ioapic(void)
for (func = 0; func < 8; func++) {
u32 class;
u32 vendor;
u8 type;
class = read_pci_config(num,slot,func,
PCI_CLASS_REVISION);
if (class == 0xffffffff)
......@@ -270,7 +271,7 @@ void __init check_ioapic(void)
}
/* No multi-function device? */
u8 type = read_pci_config_byte(num,slot,func,
type = read_pci_config_byte(num,slot,func,
PCI_HEADER_TYPE);
if (!(type & 0x80))
break;
......
......@@ -132,13 +132,13 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag
* Don't allow anybody to remap normal RAM that we're using..
*/
if (phys_addr < virt_to_phys(high_memory)) {
#ifndef CONFIG_DISCONTIGMEM
char *t_addr, *t_end;
struct page *page;
t_addr = __va(phys_addr);
t_end = t_addr + (size - 1);
#ifndef CONFIG_DISCONTIGMEM
struct page *page;
for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++)
if(!PageReserved(page))
return NULL;
......
......@@ -39,7 +39,7 @@ extern void setup_per_cpu_areas(void);
#define DEFINE_PER_CPU(type, name) \
__typeof__(type) per_cpu__##name
#define per_cpu(var, cpu) ((void)cpu, per_cpu__##var)
#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var))
#define __get_cpu_var(var) per_cpu__##var
#endif /* SMP */
......
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