Skip to contentSkip to conversation

Compiler warnings and remove unused code....

PATCH In review Steven J. Hill 6 participants 14 messages Jan 30, 2002 – Jan 31, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Compiler warnings and remove unused code....

Ralf,

Attached is a patch to clean up a bunch of compiler warnings. Specifically ones associated with gcc-3.x compilers and one use of __FUNCTION__ soon to be deprecated. Also added some #ifdef's for HIGHMEM and removed unused 5432 MM code. Please apply.

-Steve

Signature · 1 line
 Steven J. Hill - Embedded SW Engineer

Index: arch/mips/kernel/irq.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/kernel/irq.c,v retrieving revision 1.4

mips/kernel/irq.c +39 -39
diff -u -r1.4 irq.c
@@ -98,7 +98,7 @@
 			p += sprintf(p, ", %s", action->name);
 		*p++ = '\n';
 	}
-	p += sprintf(p, "ERR: %10lu\n", irq_err_count);
+	p += sprintf(p, "ERR: %10lu\n", (unsigned long) irq_err_count.counter);
 	return p - buf;
 }
 
@@ -812,6 +812,44 @@
 	return irq_found;
 }
 
+#define MAX_NAMELEN 10
+
+static struct proc_dir_entry * root_irq_dir;
+static struct proc_dir_entry * irq_dir [NR_IRQS];
+
+static void register_irq_proc (unsigned int irq)
+{
+	char name [MAX_NAMELEN];
+
+	if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
+			irq_dir[irq])
+		return;
+
+	memset(name, 0, MAX_NAMELEN);
+	sprintf(name, "%d", irq);
+
+	/* create /proc/irq/1234 */
+	irq_dir[irq] = proc_mkdir(name, root_irq_dir);
+
+#if CONFIG_SMP
+	{
+		struct proc_dir_entry *entry;
+
+		/* create /proc/irq/1234/smp_affinity */
+		entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
+
+		if (entry) {
+			entry->nlink = 1;
+			entry->data = (void *)(long)irq;
+			entry->read_proc = irq_affinity_read_proc;
+			entry->write_proc = irq_affinity_write_proc;
+		}
+
+		smp_affinity_entry[irq] = entry;
+	}
+#endif
+}
+
 /* this was setup_x86_irq but it seems pretty generic */
 int setup_irq(unsigned int irq, struct irqaction * new)
 {
@@ -887,9 +925,6 @@
 EXPORT_SYMBOL(enable_irq);
 EXPORT_SYMBOL(probe_irq_mask);
 
-static struct proc_dir_entry * root_irq_dir;
-static struct proc_dir_entry * irq_dir [NR_IRQS];
-
 #define HEX_DIGITS 8
 
 static unsigned int parse_hex_value (const char *buffer,
@@ -990,41 +1025,6 @@
 
 	*mask = new_value;
 	return full_count;
-}
-
-#define MAX_NAMELEN 10
-
-static void register_irq_proc (unsigned int irq)
-{
-	char name [MAX_NAMELEN];
-
-	if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
-			irq_dir[irq])
-		return;
-
-	memset(name, 0, MAX_NAMELEN);
-	sprintf(name, "%d", irq);
-
-	/* create /proc/irq/1234 */
-	irq_dir[irq] = proc_mkdir(name, root_irq_dir);
-
-#if CONFIG_SMP
-	{
-		struct proc_dir_entry *entry;
-
-		/* create /proc/irq/1234/smp_affinity */
-		entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
-
-		if (entry) {
-			entry->nlink = 1;
-			entry->data = (void *)(long)irq;
-			entry->read_proc = irq_affinity_read_proc;
-			entry->write_proc = irq_affinity_write_proc;
-		}
-
-		smp_affinity_entry[irq] = entry;
-	}
-#endif
 }
 
 unsigned long prof_cpu_mask = -1;

Index: arch/mips/kernel/pci-dma.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/kernel/pci-dma.c,v retrieving revision 1.3

mips/kernel/pci-dma.c +1 -1
diff -u -r1.3 pci-dma.c
@@ -30,7 +30,7 @@
 		memset(ret, 0, size);
 #ifdef CONFIG_NONCOHERENT_IO
 		dma_cache_wback_inv((unsigned long) ret, size);
-		ret = KSEG1ADDR(ret);
+		ret = (void *) KSEG1ADDR(ret);
 #endif
 		*dma_handle = virt_to_bus(ret);
 	}

Index: arch/mips/kernel/setup.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/kernel/setup.c,v retrieving revision 1.8

mips/kernel/setup.c +1 -1
diff -u -r1.8 setup.c
@@ -877,7 +877,7 @@
 #ifndef CONFIG_HIGHMEM
 		/* Maximum memory usable is what is directly addressable */
 		printk(KERN_WARNING "Warning only %ldMB will be used.\n",
-		       MAXMEM>>20);
+		       (unsigned long) (MAXMEM>>20));
 		printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
 #endif
 	}

Index: arch/mips/kernel/traps.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/kernel/traps.c,v retrieving revision 1.8

mips/kernel/traps.c +7 -7
diff -u -r1.8 traps.c
@@ -327,25 +327,25 @@
 
 static spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
 
-void __die(const char * str, struct pt_regs * regs, const char *where,
-           unsigned long line)
+void __die(const char * str, struct pt_regs * regs, const char *file,
+	const char *function, unsigned long line)
 {
 	console_verbose();
 	spin_lock_irq(&die_lock);
 	printk("%s", str);
-	if (where)
-		printk(" in %s, line %ld", where, line);
+	if (file)
+		printk(" in %s:%s, line %ld", file, function, line);
 	printk(":\n");
 	show_registers(regs);
 	spin_unlock_irq(&die_lock);
 	do_exit(SIGSEGV);
 }
 
-void __die_if_kernel(const char * str, struct pt_regs * regs, const char *where,
-	unsigned long line)
+void __die_if_kernel(const char * str, struct pt_regs * regs, const char *file,
+	const char *function, unsigned long line)
 {
 	if (!user_mode(regs))
-		__die(str, regs, where, line);
+		__die(str, regs, file, function, line);
 }
 
 extern const struct exception_table_entry __start___dbe_table[];

Index: arch/mips/math-emu/ieee754xcpt.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/math-emu/ieee754xcpt.c,v retrieving revision 1.1.1.1

mips/math-emu/ieee754xcpt.c +1 -0
diff -u -r1.1.1.1 ieee754xcpt.c
@@ -30,6 +30,7 @@
  *************************************************************************/
 
 #include "ieee754.h"
+#include <linux/kernel.h>
 
 /*
  * Very naff exception handler (you can plug in your own and

Index: arch/mips/math-emu/sp_sub.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/math-emu/sp_sub.c,v retrieving revision 1.2

mips/math-emu/sp_sub.c +2 -1
diff -u -r1.2 sp_sub.c
@@ -167,11 +167,12 @@
 			xe = xe;
 			xs = ys;
 		}
-		if (xm == 0)
+		if (xm == 0) {
 			if (ieee754_csr.rm == IEEE754_RD)
 				return ieee754sp_zero(1);	/* round negative inf. => sign = -1 */
 			else
 				return ieee754sp_zero(0);	/* other round modes   => sign = 1 */
+		}
 
 		/* normalize to rounding precision 
 		 */

Index: arch/mips/mm/c-r5432.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/mm/c-r5432.c,v retrieving revision 1.1

mips/mm/c-r5432.c +0 -28
diff -u -r1.1 c-r5432.c
@@ -42,34 +42,6 @@
 /* -------------------------------------------------------------------- */
 /* #include <asm/r4kcache.h> */
 
-static inline void flush_icache_line_indexed(unsigned long addr)
-{
-	__asm__ __volatile__(
-		".set noreorder\n\t"
-		".set mips3\n\t"
-		"cache %1, (%0)\n\t"
-		"cache %1, 1(%0)\n\t"
-		".set mips0\n\t"
-		".set reorder"
-		:
-		: "r" (addr),
-		  "i" (Index_Invalidate_I));
-}
-
-static inline void flush_dcache_line_indexed(unsigned long addr)
-{
-	__asm__ __volatile__(
-		".set noreorder\n\t"
-		".set mips3\n\t"
-		"cache %1, (%0)\n\t"
-		"cache %1, 1(%0)\n\t"
-		".set mips0\n\t"
-		".set reorder"
-		:
-		: "r" (addr),
-		  "i" (Index_Writeback_Inv_D));
-}
-
 static inline void flush_icache_line(unsigned long addr)
 {
 	__asm__ __volatile__(

Index: arch/mips/mm/fault.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/mm/fault.c,v
retrieving revision 1.5

mips/mm/fault.c +3 -0
diff -u -r1.5 fault.c
@@ -18,6 +18,9 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/version.h>
+#ifdef CONFIG_VT
+#include <linux/vt_kern.h>
+#endif
 
 #include <asm/hardirq.h>
 #include <asm/pgalloc.h>

Index: arch/mips/mm/init.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/mm/init.c,v
retrieving revision 1.3

mips/mm/init.c +6 -1
diff -u -r1.3 init.c
@@ -161,6 +161,7 @@
 extern char _ftext, _etext, _fdata, _edata;
 extern char __init_begin, __init_end;
 
+#ifdef CONFIG_HIGHMEM
 static void __init fixrange_init (unsigned long start, unsigned long end,
 	pgd_t *pgd_base)
 {
@@ -189,13 +190,17 @@
 		j = 0;
 	}
 }
+#endif
 
 void __init pagetable_init(void)
 {
+#ifdef CONFIG_HIGHMEM
 	unsigned long vaddr;
-	pgd_t *pgd, *pgd_base;
+	pgd_t *pgd;
 	pmd_t *pmd;
 	pte_t *pte;
+#endif
+	pgd_t *pgd_base;
 
 	/* Initialize the entire pgd.  */
 	pgd_init((unsigned long)swapper_pg_dir);

Index: drivers/ide/ide-probe.c
===================================================================
RCS file: /data/cvs/settop/drivers/ide/ide-probe.c,v retrieving revision 1.2

ide/ide-probe.c +3 -3
diff -u -r1.2 ide-probe.c
@@ -720,9 +720,9 @@
 
 #if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__)
 	printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", hwif->name,
-		hwif->io_ports[IDE_DATA_OFFSET],
-		hwif->io_ports[IDE_DATA_OFFSET]+7,
-		hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq);
+		(unsigned int) hwif->io_ports[IDE_DATA_OFFSET],
+		(unsigned int) hwif->io_ports[IDE_DATA_OFFSET]+7,
+		(unsigned int) hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq);
 #elif defined(__sparc__)
 	printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %s", hwif->name,
 		hwif->io_ports[IDE_DATA_OFFSET],

Index: drivers/pci/pci.ids
===================================================================
RCS file: /data/cvs/settop/drivers/pci/pci.ids,v
retrieving revision 1.3

pci/pci.ids +2 -2
diff -u -r1.3 pci.ids
@@ -1392,7 +1392,7 @@
 109e  Brooktree Corporation
 	0350  Bt848 TV with DMA push
 	0351  Bt849A Video capture
-	036c  Bt879(??) Video Capture
+	036c  Bt879(\?\?) Video Capture
 		13e9 0070  Win/TV (Video Section)
 	036e  Bt878
 		0070 13eb  WinTV/GO
@@ -4656,7 +4656,7 @@
 270b  Xantel Corporation
 270f  Chaintech Computer Co. Ltd
 2711  AVID Technology Inc.
-2a15  3D Vision(???)
+2a15  3D Vision(\?\?\?)
 3000  Hansol Electronics Inc.
 3142  Post Impression Systems.
 3388  Hint Corp

Index: drivers/pci/proc.c
===================================================================
RCS file: /data/cvs/settop/drivers/pci/proc.c,v
retrieving revision 1.3

pci/proc.c +2 -1
diff -u -r1.3 proc.c
@@ -200,7 +200,7 @@
 static int proc_bus_pci_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	const struct proc_dir_entry *dp = inode->u.generic_ip;
-	struct pci_dev *dev = dp->data;
+	struct pci_dev *dev;
 #ifdef HAVE_PCI_MMAP
 	struct pci_filp_private *fpriv = file->private_data;
 #endif /* HAVE_PCI_MMAP */
@@ -208,6 +208,7 @@
 
 	switch (cmd) {
 	case PCIIOC_CONTROLLER:
+		dev = dp->data;
 		ret = pci_controller_num(dev);
 		break;
 

Index: fs/file.c
===================================================================
RCS file: /data/cvs/settop/fs/file.c,v
retrieving revision 1.1.1.1

file.c +2 -2
diff -u -r1.1.1.1 file.c
@@ -36,7 +36,7 @@
 	int size = num * sizeof(struct file *);
 
 	if (!array) {
-		printk (KERN_ERR __FUNCTION__ "array = 0 (num = %d)\n", num);
+		printk (KERN_ERR "%s array = 0 (num = %d)\n", __FUNCTION__, num);
 		return;
 	}
 
@@ -145,7 +145,7 @@
 	int size = num / 8;
 
 	if (!array) {
-		printk (KERN_ERR __FUNCTION__ "array = 0 (num = %d)\n", num);
+		printk (KERN_ERR "%s array = 0 (num = %d)\n", __FUNCTION__, num);
 		return;
 	}
 	

Index: fs/super.c
===================================================================
RCS file: /data/cvs/settop/fs/super.c,v
retrieving revision 1.5

super.c +1 -1
diff -u -r1.5 super.c
@@ -1001,7 +1001,7 @@
 retry:
 	bdev = bdget(kdev_t_to_nr(ROOT_DEV));
 	if (!bdev)
-		panic(__FUNCTION__ ": unable to allocate root device");
+		panic("%s: unable to allocate root device", __FUNCTION__);
 	bdev->bd_op = devfs_get_ops (handle); /* Increments module use count */
 	path_start = devfs_generate_path (handle, path + 5, sizeof (path) - 5);
 	mode = FMODE_READ;

Index: include/asm-mips/system.h
===================================================================
RCS file: /data/cvs/settop/include/asm-mips/system.h,v retrieving revision 1.5

asm-mips/system.h +6 -6
diff -u -r1.5 system.h
@@ -275,14 +275,14 @@
 
 extern void *set_except_vector(int n, void *addr);
 
-extern void __die(const char *, struct pt_regs *, const char *where,
-	unsigned long line) __attribute__((noreturn));
-extern void __die_if_kernel(const char *, struct pt_regs *, const char *where,
-	unsigned long line);
+extern void __die(const char *, struct pt_regs *, const char *file,
+	const char *function, unsigned long line) __attribute__((noreturn));
+extern void __die_if_kernel(const char *, struct pt_regs *, const char *file,
+	const char *function, unsigned long line);
 
 #define die(msg, regs)							\
-	__die(msg, regs, __FILE__ ":"__FUNCTION__, __LINE__)
+	__die(msg, regs, __FILE__, __FUNCTION__, __LINE__)
 #define die_if_kernel(msg, regs)					\
-	__die_if_kernel(msg, regs, __FILE__ ":"__FUNCTION__, __LINE__)
+	__die_if_kernel(msg, regs, __FILE__, __FUNCTION__, __LINE__)
 
 #endif /* _ASM_SYSTEM_H */

Index: include/linux/rtnetlink.h
===================================================================
RCS file: /data/cvs/settop/include/linux/rtnetlink.h,v retrieving revision 1.2

linux/rtnetlink.h +2 -2
diff -u -r1.2 rtnetlink.h
@@ -586,9 +586,9 @@
 extern void rtnetlink_init(void);
 
 #define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0)  { up(&rtnl_sem); \
-printk("RTNL: assertion failed at " __FILE__ "(%d):" __FUNCTION__ "\n", __LINE__); } \
+printk("RTNL: assertion failed at " __FILE__ "(%d): %s\n", __LINE__, __FUNCTION__); } \
 		   } while(0);
-#define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d):" __FUNCTION__ "\n", __LINE__); }
+#define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d): %s\n", __LINE__, __FUNCTION__); }
 
 
 #endif /* __KERNEL__ */

Index: net/netlink/af_netlink.c
===================================================================
RCS file: /data/cvs/settop/net/netlink/af_netlink.c,v retrieving revision 1.3

netlink/af_netlink.c +1 -1
diff -u -r1.3 af_netlink.c
@@ -48,7 +48,7 @@
 #define NL_EMULATE_DEV
 #endif
 
-#define BUG_TRAP(x) if (!(x)) { printk("Assertion (" #x ") failed at " __FILE__ "(%d):" __FUNCTION__ "\n", __LINE__); }
+#define BUG_TRAP(x) if (!(x)) { printk("Assertion (" #x ") failed at " __FILE__ "(%d):%s\n", __LINE__, __FUNCTION__); }
 
 struct netlink_opt
 {
#1 lore raw

Steve,

Quoted 5 lines

Attached is a patch to clean up a bunch of compiler warnings. Specifically ones associated with gcc-3.x compilers and one use of __FUNCTION__ soon to be deprecated. Also added some #ifdef's for HIGHMEM and removed unused 5432 MM code. Please apply.
-Steve

I used your toolset to compile busybox and everything else pretty well. But when I got to the end of "make linux", I got:

mipsel-linux-ld -G 0 -static -T arch/mips/ld.script.0x80002000 arch/mips/kernel/head.o arch/mips/kernel/init_task.o init/main.o init/version.o \
        --start-group \
        arch/mips/kernel/kernel.o arch/mips/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o arch/mips/math-emu/fpu_emulator.o arch/mips/ramdisk/ramdisk.o \
 drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/atm/atm.o drivers/pci/driver.o drivers/mtd/mtdlink.o drivers/usb/usbdrv.o drivers/input/inputdrv.o \
net/network.o \
arch/mips/lib/lib.a /home/espin/linux/lib/lib.a arch/mips/korva/korva.a \
    --end-group \
    -o vmlinux

drivers/char/char.o(.data+0x3958): undefined reference to local symbols in discarded section .text.exit' drivers/net/net.o(.data+0x17c): undefined reference to local symbols in discarded section .text.exit' drivers/usb/usbdrv.o(.data+0x4b0): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1

This is linux.2.4.16 + sourceforge/mipslinux (a few weeks old).

Geoff

Signature · 1 line
[email protected]
#2 lore raw
Quoted 7 lines · Geoffrey Espin

drivers/char/char.o(.data+0x3958): undefined reference to local symbols in discarded section .text.exit' drivers/net/net.o(.data+0x17c): undefined reference to local symbols in discarded section .text.exit' drivers/usb/usbdrv.o(.data+0x4b0): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1

This is linux.2.4.16 + sourceforge/mipslinux (a few weeks old).

These errors are not MIPS-specific. They were introduced by a stricter
symbol checking in recent binutils. Many of them (but possibly not all) are removed in Linux 2.4.17. Please try the current version and see if they persist.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#3 lore raw

I think --noinhibit-exec worked for me as a temporary measure until I upgraded the kernel.

Regards,
Brad

----- Original Message -----
From: "Maciej W. Rozycki" <[email protected]>
To: "Geoffrey Espin" <[email protected]>
Cc: "Steven J. Hill" <[email protected]>; <[email protected]>
Sent: Wednesday, January 30, 2002 1:35 PM
Subject: Re: [PATCH] Compiler warnings and remove unused code....

Quoted 3 lines · Geoffrey Espin
Quoted 2 lines

drivers/char/char.o(.data+0x3958): undefined reference to `local symbols

in discarded section .text.exit'

Quoted 1 line
Quoted 1 line

drivers/net/net.o(.data+0x17c): undefined reference to `local symbols in

discarded section .text.exit'

Quoted 1 line
Quoted 1 line

drivers/usb/usbdrv.o(.data+0x4b0): undefined reference to `local symbols

in discarded section .text.exit'

Quoted 15 lines
Quoted 4 lines

make: *** [vmlinux] Error 1

This is linux.2.4.16 + sourceforge/mipslinux (a few weeks old).

These errors are not MIPS-specific. They were introduced by a stricter
symbol checking in recent binutils. Many of them (but possibly not all) are removed in Linux 2.4.17. Please try the current version and see if they persist.

--

(quoted diff) +3 -0
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#4 lore raw
In reply to Maciej W. Rozycki

Maciej,

Quoted 5 lines
Quoted 1 line

This is linux.2.4.16 + sourceforge/mipslinux (a few weeks old).

These errors are not MIPS-specific. They were introduced by a stricter
symbol checking in recent binutils. Many of them (but possibly not all) are removed in Linux 2.4.17. Please try the current version and see if they persist.

Thanks! Thought so. I was afraid of that. :-)
[Not sure if/when I'll move up again.]

Steve: you might want to add that caveat to your toolchain announcement.

Geoff

Signature · 1 line
[email protected]
#5 lore raw
In reply to Geoffrey Espin
Quoted 18 lines
Quoted 6 lines

Attached is a patch to clean up a bunch of compiler warnings. Specifically ones associated with gcc-3.x compilers and one use of __FUNCTION__ soon to be deprecated. Also added some #ifdef's for HIGHMEM and removed unused 5432 MM code. Please apply.
-Steve

I used your toolset to compile busybox and everything else pretty well. But when I got to the end of "make linux", I got:

mipsel-linux-ld -G 0 -static -T arch/mips/ld.script.0x80002000 arch/mips/kernel/head.o arch/mips/kernel/init_task.o init/main.o init/version.o \
        --start-group \
        arch/mips/kernel/kernel.o arch/mips/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o arch/mips/math-emu/fpu_emulator.o arch/mips/ramdisk/ramdisk.o \
 drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/atm/atm.o drivers/pci/driver.o drivers/mtd/mtdlink.o drivers/usb/usbdrv.o drivers/input/inputdrv.o \
net/network.o \
arch/mips/lib/lib.a /home/espin/linux/lib/lib.a arch/mips/korva/korva.a \
    --end-group \
    -o vmlinux
Quoted 7 lines

drivers/char/char.o(.data+0x3958): undefined reference to local symbols in discarded section .text.exit' drivers/net/net.o(.data+0x17c): undefined reference to local symbols in discarded section .text.exit' drivers/usb/usbdrv.o(.data+0x4b0): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1

This is linux.2.4.16 + sourceforge/mipslinux (a few weeks old).

I'm glad you tried it. I was tempted to apply it to CVS.

#6 lore raw

James,

Quoted 2 lines
Quoted 1 line

This is linux.2.4.16 + sourceforge/mipslinux (a few weeks old).

I'm glad you tried it. I was tempted to apply it to CVS.

??? apparently it should work for you at 2.4.17.

Not sure what you mean by "apply it to CVS".

It would be nice to have a newer "recommended/suggested" GCC. Though to be honest I've never had any problem with HJ Lu's rh71. Just thought I do the favour of "tester", for Steve.

Geoff

Signature · 1 line
[email protected]
#7 lore raw
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

This is linux.2.4.16 + sourceforge/mipslinux (a few weeks old).

I'm glad you tried it. I was tempted to apply it to CVS.

??? apparently it should work for you at 2.4.17.

I will gibe it a try against the SF mips CVS.

Quoted 2 lines

Not sure what you mean by "apply it to CVS".

Place it in the SourceForge Mips Tree.

#8 lore raw
In reply to Geoffrey Espin
Quoted 25 lines · Geoffrey Espin

Steve,

Quoted 5 lines

Attached is a patch to clean up a bunch of compiler warnings. Specifically ones associated with gcc-3.x compilers and one use of __FUNCTION__ soon to be deprecated. Also added some #ifdef's for HIGHMEM and removed unused 5432 MM code. Please apply.
-Steve

I used your toolset to compile busybox and everything else pretty well. But when I got to the end of "make linux", I got:

mipsel-linux-ld -G 0 -static -T arch/mips/ld.script.0x80002000 arch/mips/kernel/head.o arch/mips/kernel/init_task.o init/main.o init/version.o \
        --start-group \
        arch/mips/kernel/kernel.o arch/mips/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o arch/mips/math-emu/fpu_emulator.o arch/mips/ramdisk/ramdisk.o \
 drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/atm/atm.o drivers/pci/driver.o drivers/mtd/mtdlink.o drivers/usb/usbdrv.o drivers/input/inputdrv.o \
net/network.o \
arch/mips/lib/lib.a /home/espin/linux/lib/lib.a arch/mips/korva/korva.a \
    --end-group \
    -o vmlinux

drivers/char/char.o(.data+0x3958): undefined reference to local symbols in discarded section .text.exit' drivers/net/net.o(.data+0x17c): undefined reference to local symbols in discarded section .text.exit' drivers/usb/usbdrv.o(.data+0x4b0): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1

Quoted 3 lines

This is linux.2.4.16 + sourceforge/mipslinux (a few weeks old).

Geoff

These were fixed in the kernel.org tree around 2.4.17 (maybe 2.4.18pre for a few of them, too).

If you just want to work around it you can comment out the /DISCARD/ {} block in arch/mips/ld.script.

Signature · 2 lines
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer
#9 lore raw
Quoted 6 lines

These were fixed in the kernel.org tree around 2.4.17 (maybe 2.4.18pre for a few of them, too).
If you just want to work around it you can comment out the /DISCARD/ {} block in arch/mips/ld.script.
Daniel Jacobowitz Carnegie Mellon University

That worked great! [comment out DISCARD section in ld.script.in]

Quoted 3 lines

I think --noinhibit-exec worked for me as a temporary measure until I upgraded the kernel.
Brad LaRonde

I'll just give you a smiley for that suggestion: :-)
Sure, it probably works.

Thanks all!

Geoff

Signature · 1 line
[email protected]
#10 lore raw
In reply to Steven J. Hill

mips/kernel/irq.c line 101

Quoted 2 lines · Steven J. Hill
mips/kernel/irq.c +1 -1
-	p += sprintf(p, "ERR: %10lu\n", irq_err_count);
+	p += sprintf(p, "ERR: %10lu\n", (unsigned long) irq_err_count.counter);

This looks bogus. How about atomic_read()?

Quoted 28 lines
mips/kernel/irq.c +28 -0
+#define MAX_NAMELEN 10
+
+static struct proc_dir_entry * root_irq_dir;
+static struct proc_dir_entry * irq_dir [NR_IRQS];
+
+static void register_irq_proc (unsigned int irq)
+{
+	char name [MAX_NAMELEN];
+
+	if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
+			irq_dir[irq])
+		return;
+
+	memset(name, 0, MAX_NAMELEN);
+	sprintf(name, "%d", irq);
+
+	/* create /proc/irq/1234 */
+	irq_dir[irq] = proc_mkdir(name, root_irq_dir);
+
+#if CONFIG_SMP
+	{
+		struct proc_dir_entry *entry;
+
+		/* create /proc/irq/1234/smp_affinity */
+		entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
+
+		if (entry) {
+			entry->nlink = 1;

mips/kernel/irq.c line 852

Quoted 10 lines
mips/kernel/irq.c +10 -0
+			entry->data = (void *)(long)irq;
+			entry->read_proc = irq_affinity_read_proc;
+			entry->write_proc = irq_affinity_write_proc;
+		}
+
+		smp_affinity_entry[irq] = entry;
+	}
+#endif
+}
+

Any specific need to move it?

mips/kernel/pci-dma.c line 33

Quoted 2 lines
mips/kernel/pci-dma.c +1 -1
-		ret = KSEG1ADDR(ret);
+		ret = (void *) KSEG1ADDR(ret);

Hmm, KSEG1ADDR() should probably use typeof(), instead.

mips/kernel/setup.c line 880

Quoted 3 lines
mips/kernel/setup.c +1 -1
 		printk(KERN_WARNING "Warning only %ldMB will be used.\n",
-		       MAXMEM>>20);
+		       (unsigned long) (MAXMEM>>20));

MAXMEM is int, how about "%d" instead?

pci/pci.ids

Quoted 2 lines
pci/pci.ids +0 -0

Are you sure it belongs here? Or is needed at all?

Otherwise OK, I think, unless I missed something.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#11 lore raw
Quoted 8 lines · Maciej W. Rozycki

mips/kernel/irq.c line 101

Quoted 2 lines · Steven J. Hill
mips/kernel/irq.c +1 -1
-     p += sprintf(p, "ERR: %10lu\n", irq_err_count);
+     p += sprintf(p, "ERR: %10lu\n", (unsigned long) irq_err_count.counter);

This looks bogus. How about atomic_read()?

Well, duh! Yeah, that would be better.

Quoted 32 lines
Quoted 32 lines
mips/kernel/irq.c +32 -0
+#define MAX_NAMELEN 10
+
+static struct proc_dir_entry * root_irq_dir;
+static struct proc_dir_entry * irq_dir [NR_IRQS];
+
+static void register_irq_proc (unsigned int irq)
+{
+     char name [MAX_NAMELEN];
+
+     if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
+                     irq_dir[irq])
+             return;
+
+     memset(name, 0, MAX_NAMELEN);
+     sprintf(name, "%d", irq);
+
+     /* create /proc/irq/1234 */
+     irq_dir[irq] = proc_mkdir(name, root_irq_dir);
+
+#if CONFIG_SMP
+     {
+             struct proc_dir_entry *entry;
+
+             /* create /proc/irq/1234/smp_affinity */
+             entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
+
+             if (entry) {
+                     entry->nlink = 1;
+                     entry->data = (void *)(long)irq;
+                     entry->read_proc = irq_affinity_read_proc;
+                     entry->write_proc = irq_affinity_write_proc;
+             }
Quoted 9 lines

mips/kernel/irq.c line 852

Quoted 6 lines
mips/kernel/irq.c +6 -0
+
+             smp_affinity_entry[irq] = entry;
+     }
+#endif
+}
+

Any specific need to move it?

Yes. Eliminates a 'implicit declaration of register_irq_proc' warning.

Quoted 5 lines

mips/kernel/pci-dma.c line 33

Quoted 2 lines
mips/kernel/pci-dma.c +1 -1
-             ret = KSEG1ADDR(ret);
+             ret = (void *) KSEG1ADDR(ret);

Hmm, KSEG1ADDR() should probably use typeof(), instead.

Fine.

Quoted 6 lines

mips/kernel/setup.c line 880

Quoted 3 lines

printk(KERN_WARNING "Warning only %ldMB will be used.\n",

mips/kernel/setup.c +1 -1
-                    MAXMEM>>20);
+                    (unsigned long) (MAXMEM>>20));

MAXMEM is int, how about "%d" instead?

Fine.

Quoted 5 lines

pci/pci.ids 30 Jan 2002 17:20:50 -0000

Quoted 2 lines
pci/pci.ids 30 Jan 2002 17:20:50 -0000 renamed from pci/pci.ids 3 Jan 2002 17:20:28 -0000 1.3 +0 -0

Are you sure it belongs here? Or is needed at all?

What happens is that when 'gendev' is ran to produce devlist.h, without the patch it spits on '??? trigraph' warnings. By escaping them, the warning disappears.

-Steve

Signature · 1 line
 Steven J. Hill - Embedded SW Engineer
#12 lore raw
Quoted 8 lines · Steven J. Hill
Quoted 5 lines

pci/pci.ids 30 Jan 2002 17:20:50 -0000

Quoted 2 lines
pci/pci.ids 30 Jan 2002 17:20:50 -0000 renamed from pci/pci.ids 3 Jan 2002 17:20:28 -0000 1.3 +0 -0

Are you sure it belongs here? Or is needed at all?

What happens is that when 'gendev' is ran to produce devlist.h, without the patch it spits on '??? trigraph' warnings. By escaping them, the warning disappears.

You should fix drivers/pci/gen-devlist.c, then (pci.ids is maintained
externally and is meant to be a plain text file -- see
http://pciids.sourceforge.net/) and submit changes to the author and, possibly, linux-kernel.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#13 lore raw
In reply to Steven J. Hill
Quoted 6 lines · Steven J. Hill

Attached is a patch to clean up a bunch of compiler warnings. Specifically ones associated with gcc-3.x compilers and one use of __FUNCTION__ soon to be deprecated. Also added some #ifdef's for HIGHMEM and removed unused 5432 MM code. Please apply.

I had no idea I would get this much email on the patch. Anyway, the toolchain that I am using to compile with is:

    binutils-20020110
    gcc-3.0.3
    glibc-2.2.3
    linux-2.4.5 headers

-Steve

Signature · 1 line
 Steven J. Hill - Embedded SW Engineer