some code cleanup for 2.4.21

Olaf Hering olh at suse.de
Sun Aug 17 23:19:32 EST 2003


This patch removes some compile warnings, cmd_line is printed by the
generic code, no need to print it 3 times.

The embedded_sysmap_end is unused.

diff -p -purNX /suse/olh/kernel/kernel_exclude.txt linuxppc64-2.4/arch/ppc64/kernel/chrp_setup.c linuxppc64-2.4.less_warnings/arch/ppc64/kernel/chrp_setup.c
--- linuxppc64-2.4/arch/ppc64/kernel/chrp_setup.c	2003-06-12 18:34:52.000000000 +0200
+++ linuxppc64-2.4.less_warnings/arch/ppc64/kernel/chrp_setup.c	2003-08-17 14:37:29.000000000 +0200
@@ -137,7 +137,6 @@ void __init chrp_request_regions(void) {
 void __init
 chrp_setup_arch(void)
 {
-	extern char cmd_line[];
 	struct device_node *root;
 	unsigned int *opprop;

@@ -158,8 +157,6 @@ chrp_setup_arch(void)
 #endif
 	ROOT_DEV = to_kdev_t(0x0802); /* sda2 (sda1 is for the kernel) */

-	printk("Boot arguments: %s\n", cmd_line);
-
 	fwnmi_init();

 #ifndef CONFIG_PPC_ISERIES
diff -p -purNX /suse/olh/kernel/kernel_exclude.txt linuxppc64-2.4/arch/ppc64/kernel/pci_dma.c linuxppc64-2.4.less_warnings/arch/ppc64/kernel/pci_dma.c
--- linuxppc64-2.4/arch/ppc64/kernel/pci_dma.c	2003-07-15 19:04:12.000000000 +0200
+++ linuxppc64-2.4.less_warnings/arch/ppc64/kernel/pci_dma.c	2003-08-17 15:15:12.000000000 +0200
@@ -554,7 +554,7 @@ static inline dma_addr_t get_tces( struc
 		   the bus address to the IOA */
 		__asm__ __volatile__ ("sync" : : : "memory");
 	} else {
-		panic("get_tces: TCE allocation failed. 0x%p 0x%lx\n",
+		panic("get_tces: TCE allocation failed. 0x%p 0x%x\n",
 		      tbl, order);
 	}

@@ -1339,7 +1339,7 @@ static dma_addr_t create_tces_sg(struct
 		   		numTces, (unsigned)(tcenum - starttcenum));

 	} else {
-		panic("PCI_DMA: TCE allocation failure in create_tces_sg. 0x%p 0x%lx\n",
+		panic("PCI_DMA: TCE allocation failure in create_tces_sg. 0x%p 0x%x\n",
 		      tbl, order);
 	}

diff -p -purNX /suse/olh/kernel/kernel_exclude.txt linuxppc64-2.4/arch/ppc64/kernel/ppc_ksyms.c linuxppc64-2.4.less_warnings/arch/ppc64/kernel/ppc_ksyms.c
--- linuxppc64-2.4/arch/ppc64/kernel/ppc_ksyms.c	2003-06-10 16:34:57.000000000 +0200
+++ linuxppc64-2.4.less_warnings/arch/ppc64/kernel/ppc_ksyms.c	2003-08-17 14:39:31.000000000 +0200
@@ -81,8 +81,8 @@ extern struct pci_dev * iSeries_vio_dev;
 #ifdef CONFIG_SHARED_MEMORY_ADDRESSING
 extern void shared_malloc(unsigned long);
 extern void shared_free(void *);
-extern int shared_task_mark();
-extern int shared_task_unmark();
+extern int shared_task_mark(void);
+extern int shared_task_unmark(void);
 #endif

 EXPORT_SYMBOL(do_signal);
diff -p -purNX /suse/olh/kernel/kernel_exclude.txt linuxppc64-2.4/arch/ppc64/kernel/prom.c linuxppc64-2.4.less_warnings/arch/ppc64/kernel/prom.c
--- linuxppc64-2.4/arch/ppc64/kernel/prom.c	2003-06-10 16:34:58.000000000 +0200
+++ linuxppc64-2.4.less_warnings/arch/ppc64/kernel/prom.c	2003-08-17 14:37:06.000000000 +0200
@@ -168,7 +168,6 @@ char *of_stdout_device = 0;

 extern struct rtas_t rtas;
 extern unsigned long klimit;
-extern unsigned long embedded_sysmap_end;
 extern struct lmb lmb;
 #ifdef CONFIG_MSCHUNKS
 extern struct msChunks msChunks;
@@ -363,7 +362,7 @@ prom_initialize_naca(unsigned long mem)
 			 * d-cache and i-cache sizes... -Peter
 			 */
 			if ( num_cpus == 1 ) {
-				u32 size, lsize, sets;
+				u32 size, lsize;

 				call_prom(RELOC("getprop"), 4, 1, node,
 					  RELOC("d-cache-size"),
@@ -631,7 +630,6 @@ prom_instantiate_rtas(void)
 	unsigned long offset = reloc_offset();
 	struct prom_t *_prom = PTRRELOC(&prom);
 	struct rtas_t *_rtas = PTRRELOC(&rtas);
-	struct naca_struct *_naca = RELOC(naca);
 	struct systemcfg *_systemcfg = RELOC(systemcfg);
 	ihandle prom_rtas;
         u32 getprop_rval;
@@ -1060,7 +1058,6 @@ prom_hold_cpus(unsigned long mem)
         unsigned long *spinloop     = __v2a(&__secondary_hold_spinloop);
         unsigned long *acknowledge  = __v2a(&__secondary_hold_acknowledge);
         unsigned long secondary_hold = (unsigned long)__v2a(*PTRRELOC((unsigned long *)__secondary_hold));
-        struct naca_struct *_naca = RELOC(naca);
         struct systemcfg *_systemcfg = RELOC(systemcfg);
 	struct paca_struct *_xPaca = PTRRELOC(&paca[0]);
 	struct prom_t *_prom = PTRRELOC(&prom);
@@ -1359,7 +1356,6 @@ prom_init(unsigned long r3, unsigned lon
 	char *p, *d;
  	unsigned long phys;
         u32 getprop_rval;
-        struct naca_struct *_naca = RELOC(naca);
         struct systemcfg *_systemcfg = RELOC(systemcfg);
 	struct paca_struct *_xPaca = PTRRELOC(&paca[0]);
 	struct prom_t *_prom = PTRRELOC(&prom);
@@ -1367,9 +1363,6 @@ prom_init(unsigned long r3, unsigned lon

 	/* Default machine type. */
 	_systemcfg->platform = PLATFORM_PSERIES;
-	/* Reset klimit to take into account the embedded system map */
-	if (RELOC(embedded_sysmap_end))
-		RELOC(klimit) = __va(PAGE_ALIGN(RELOC(embedded_sysmap_end)));

 	/* Get a handle to the prom entry point before anything else */
 	_prom->entry = pp;
@@ -2425,7 +2418,7 @@ print_properties(struct device_node *np)


 void __init
-abort()
+abort(void)
 {
 #ifdef CONFIG_XMON
 	xmon(NULL);
diff -p -purNX /suse/olh/kernel/kernel_exclude.txt linuxppc64-2.4/arch/ppc64/kernel/setup.c linuxppc64-2.4.less_warnings/arch/ppc64/kernel/setup.c
--- linuxppc64-2.4/arch/ppc64/kernel/setup.c	2003-08-15 19:09:33.000000000 +0200
+++ linuxppc64-2.4.less_warnings/arch/ppc64/kernel/setup.c	2003-08-17 14:38:27.000000000 +0200
@@ -150,7 +150,7 @@ void setup_system(unsigned long r3, unsi
 	printk("-----------------------------------------------------\n");
 	printk("naca                          = 0x%p\n", naca);
 	printk("naca->pftSize                 = 0x%lx\n", naca->pftSize);
-	printk("naca->paca                    = 0x%lx\n\n", naca->paca);
+	printk("naca->paca                    = 0x%p\n\n", naca->paca);
 	printk("systemcfg                     = 0x%p\n", systemcfg);
 	printk("systemcfg->platform           = 0x%x\n", systemcfg->platform);
 	printk("systemcfg->processor          = 0x%x\n", systemcfg->processor);
@@ -332,7 +332,6 @@ struct seq_operations cpuinfo_op = {
 void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5,
 		  unsigned long r6, unsigned long r7)
 {
-	struct device_node *chosen;
 	char *p;

 #ifdef CONFIG_BLK_DEV_INITRD
@@ -375,8 +374,7 @@ void parse_cmd_line(unsigned long r3, un
 						 "AUTOCONSOLE console=%s %s",
 						 val, cmd_line);
 					memcpy(cmd_line, tmp_cmd_line, 512);
-					printk("console= not found, add console=%s\ncmd_line is now %s\n",
-					       val, cmd_line);
+					printk("console= not found, add console=%s\n", val);
 				}
 			}
 		}
@@ -406,6 +404,7 @@ void parse_cmd_line(unsigned long r3, un
 }


+#if 0
 char *bi_tag2str(unsigned long tag)
 {
 	switch (tag) {
@@ -427,6 +426,7 @@ char *bi_tag2str(unsigned long tag)
 		return "BI_UNKNOWN";
 	}
 }
+#endif

 int parse_bootinfo(void)
 {
diff -p -purNX /suse/olh/kernel/kernel_exclude.txt linuxppc64-2.4/arch/ppc64/mm/init.c linuxppc64-2.4.less_warnings/arch/ppc64/mm/init.c
--- linuxppc64-2.4/arch/ppc64/mm/init.c	2003-06-10 16:34:59.000000000 +0200
+++ linuxppc64-2.4.less_warnings/arch/ppc64/mm/init.c	2003-08-17 15:12:23.000000000 +0200
@@ -30,6 +30,7 @@
 #include <linux/ptrace.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
+#include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/stddef.h>
 #include <linux/vmalloc.h>
@@ -682,7 +683,6 @@ void *shared_malloc(unsigned long size)

 void shared_free(void *addr) {
 	struct vm_struct **p, *tmp;
-	unsigned long size = 0;

 	if (!addr)
 		return;
@@ -693,7 +693,7 @@ void shared_free(void *addr) {
 	}
 	spin_lock(&shared_malloc_lock);

-	printk("shared_free: addr = 0x%lx\n", addr);
+	printk("shared_free: addr = 0x%p\n", addr);

 	/* Scan the memory list for an entry matching
 	 * the address to be freed, get the size (in bytes)
@@ -755,14 +755,14 @@ static struct vm_struct *get_shared_area
 	return area;
 }

-int shared_task_mark() {
+int shared_task_mark(void) {
 	current->thread.flags |= PPC_FLAG_SHARED;
 	printk("current->thread.flags = 0x%lx\n", current->thread.flags);

 	return 0;
 }

-int shared_task_unmark() {
+int shared_task_unmark(void) {
 	if(current->thread.flags & PPC_FLAG_SHARED) {
 		current->thread.flags &= (~PPC_FLAG_SHARED);
 		return 0;
--
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list