mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gcc-3.4.0 fixes for 2.6.6-rc3 x86_64 kernel
@ 2004-05-02 11:51 Mikael Pettersson
  2004-05-09 12:35 ` Andi Kleen
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2004-05-02 11:51 UTC (permalink / raw)
  To: ak; +Cc: linux-kernel

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

Tested on UP and SMP (with the ARCH_MIN_TASKALIGN fix).

/Mikael

--- linux-2.6.6-rc3/arch/x86_64/boot/compressed/misc.c.~1~	2003-09-28 12:19:38.000000000 +0200
+++ linux-2.6.6-rc3/arch/x86_64/boot/compressed/misc.c	2004-04-30 13:43:28.000000000 +0200
@@ -92,7 +92,7 @@
 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 @@
 		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 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 @@
 	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;
 }
--- linux-2.6.6-rc3/arch/x86_64/ia32/ia32_signal.c.~1~	2004-04-30 13:19:26.000000000 +0200
+++ linux-2.6.6-rc3/arch/x86_64/ia32/ia32_signal.c	2004-04-30 13:59:06.000000000 +0200
@@ -98,6 +98,7 @@
 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 @@
 
 	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;
 }
--- linux-2.6.6-rc3/arch/x86_64/kernel/io_apic.c.~1~	2004-04-30 13:19:26.000000000 +0200
+++ linux-2.6.6-rc3/arch/x86_64/kernel/io_apic.c	2004-04-30 13:45:56.000000000 +0200
@@ -237,6 +237,7 @@
 			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,8 +271,8 @@
 				} 
 
 				/* No multi-function device? */
-				u8 type = read_pci_config_byte(num,slot,func,
-							       PCI_HEADER_TYPE);
+				type = read_pci_config_byte(num,slot,func,
+							    PCI_HEADER_TYPE);
 				if (!(type & 0x80))
 					break;
 			} 
--- linux-2.6.6-rc3/arch/x86_64/mm/ioremap.c.~1~	2003-10-09 00:24:52.000000000 +0200
+++ linux-2.6.6-rc3/arch/x86_64/mm/ioremap.c	2004-04-30 13:48:24.000000000 +0200
@@ -132,13 +132,13 @@
 	 * 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;
--- linux-2.6.6-rc3/include/asm-x86_64/percpu.h.~1~	2003-09-09 14:22:30.000000000 +0200
+++ linux-2.6.6-rc3/include/asm-x86_64/percpu.h	2004-04-30 13:37:18.000000000 +0200
@@ -39,7 +39,7 @@
 #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 */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gcc-3.4.0 fixes for 2.6.6-rc3 x86_64 kernel
  2004-05-02 11:51 [PATCH] gcc-3.4.0 fixes for 2.6.6-rc3 x86_64 kernel Mikael Pettersson
@ 2004-05-09 12:35 ` Andi Kleen
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2004-05-09 12:35 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: ak, linux-kernel

On Sun, May 02, 2004 at 01:51:16PM +0200, Mikael Pettersson wrote:
> Here are some patches to fix compilation warnings from
> gcc-3.4.0 in the 2.6.6-rc3 x86_64 kernel.

Thanks. Merged now.

-Andi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-09 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-02 11:51 [PATCH] gcc-3.4.0 fixes for 2.6.6-rc3 x86_64 kernel Mikael Pettersson
2004-05-09 12:35 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®