* [PATCH] Compiler warnings and remove unused code....
@ 2002-01-30 17:29 Steven J. Hill
2002-01-30 18:23 ` Geoffrey Espin
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Steven J. Hill @ 2002-01-30 17:29 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
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
--
Steven J. Hill - Embedded SW Engineer
[-- Attachment #2: mips-warnings-20020130.patch --]
[-- Type: application/octet-stream, Size: 15398 bytes --]
Index: arch/mips/kernel/irq.c
===================================================================
RCS file: /data/cvs/settop/arch/mips/kernel/irq.c,v
retrieving revision 1.4
diff -u -r1.4 irq.c
--- arch/mips/kernel/irq.c 3 Jan 2002 17:18:56 -0000 1.4
+++ arch/mips/kernel/irq.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.3 pci-dma.c
--- arch/mips/kernel/pci-dma.c 3 Jan 2002 17:18:56 -0000 1.3
+++ arch/mips/kernel/pci-dma.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.8 setup.c
--- arch/mips/kernel/setup.c 29 Jan 2002 18:54:50 -0000 1.8
+++ arch/mips/kernel/setup.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.8 traps.c
--- arch/mips/kernel/traps.c 29 Jan 2002 18:54:51 -0000 1.8
+++ arch/mips/kernel/traps.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.1.1.1 ieee754xcpt.c
--- arch/mips/math-emu/ieee754xcpt.c 26 Apr 2001 14:32:26 -0000 1.1.1.1
+++ arch/mips/math-emu/ieee754xcpt.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.2 sp_sub.c
--- arch/mips/math-emu/sp_sub.c 3 Jan 2002 17:18:58 -0000 1.2
+++ arch/mips/math-emu/sp_sub.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.1 c-r5432.c
--- arch/mips/mm/c-r5432.c 3 Jan 2002 17:10:07 -0000 1.1
+++ arch/mips/mm/c-r5432.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.5 fault.c
--- arch/mips/mm/fault.c 29 Jan 2002 18:54:51 -0000 1.5
+++ arch/mips/mm/fault.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.3 init.c
--- arch/mips/mm/init.c 29 Jan 2002 18:54:51 -0000 1.3
+++ arch/mips/mm/init.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.2 ide-probe.c
--- drivers/ide/ide-probe.c 3 Jan 2002 17:19:53 -0000 1.2
+++ drivers/ide/ide-probe.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.3 pci.ids
--- drivers/pci/pci.ids 3 Jan 2002 17:20:28 -0000 1.3
+++ drivers/pci/pci.ids 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.3 proc.c
--- drivers/pci/proc.c 3 Jan 2002 17:20:28 -0000 1.3
+++ drivers/pci/proc.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.1.1.1 file.c
--- fs/file.c 26 Apr 2001 14:35:20 -0000 1.1.1.1
+++ fs/file.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.5 super.c
--- fs/super.c 3 Jan 2002 17:21:04 -0000 1.5
+++ fs/super.c 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.5 system.h
--- include/asm-mips/system.h 29 Jan 2002 18:54:49 -0000 1.5
+++ include/asm-mips/system.h 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.2 rtnetlink.h
--- include/linux/rtnetlink.h 3 Jan 2002 17:21:36 -0000 1.2
+++ include/linux/rtnetlink.h 30 Jan 2002 17:20:50 -0000
@@ -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
diff -u -r1.3 af_netlink.c
--- net/netlink/af_netlink.c 3 Jan 2002 17:21:50 -0000 1.3
+++ net/netlink/af_netlink.c 30 Jan 2002 17:20:50 -0000
@@ -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
{
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 17:29 [PATCH] Compiler warnings and remove unused code Steven J. Hill
@ 2002-01-30 18:23 ` Geoffrey Espin
2002-01-30 18:35 ` Maciej W. Rozycki
` (2 more replies)
2002-01-30 18:55 ` Maciej W. Rozycki
2002-01-30 19:15 ` Steven J. Hill
2 siblings, 3 replies; 15+ messages in thread
From: Geoffrey Espin @ 2002-01-30 18:23 UTC (permalink / raw)
To: Steven J. Hill; +Cc: linux-mips
Steve,
> 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
--
espin@idiom.com
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:23 ` Geoffrey Espin
@ 2002-01-30 18:35 ` Maciej W. Rozycki
2002-01-30 18:39 ` Geoffrey Espin
2002-01-30 18:46 ` Bradley D. LaRonde
2002-01-30 18:39 ` James Simmons
2002-01-30 18:41 ` Daniel Jacobowitz
2 siblings, 2 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2002-01-30 18:35 UTC (permalink / raw)
To: Geoffrey Espin; +Cc: Steven J. Hill, linux-mips
On Wed, 30 Jan 2002, Geoffrey Espin wrote:
> 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.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:35 ` Maciej W. Rozycki
@ 2002-01-30 18:39 ` Geoffrey Espin
2002-01-30 18:46 ` Bradley D. LaRonde
1 sibling, 0 replies; 15+ messages in thread
From: Geoffrey Espin @ 2002-01-30 18:39 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Steven J. Hill, linux-mips
Maciej,
> > 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
--
espin@idiom.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:35 ` Maciej W. Rozycki
2002-01-30 18:39 ` Geoffrey Espin
@ 2002-01-30 18:46 ` Bradley D. LaRonde
2002-01-30 18:46 ` Bradley D. LaRonde
1 sibling, 1 reply; 15+ messages in thread
From: Bradley D. LaRonde @ 2002-01-30 18:46 UTC (permalink / raw)
To: Maciej W. Rozycki, Geoffrey Espin; +Cc: Steven J. Hill, linux-mips
I think --noinhibit-exec worked for me as a temporary measure until I
upgraded the kernel.
Regards,
Brad
----- Original Message -----
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
To: "Geoffrey Espin" <espin@idiom.com>
Cc: "Steven J. Hill" <sjhill@cotw.com>; <linux-mips@oss.sgi.com>
Sent: Wednesday, January 30, 2002 1:35 PM
Subject: Re: [PATCH] Compiler warnings and remove unused code....
> On Wed, 30 Jan 2002, Geoffrey Espin wrote:
>
> > 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.
>
> --
> + Maciej W. Rozycki, Technical University of Gdansk, Poland +
> +--------------------------------------------------------------+
> + e-mail: macro@ds2.pg.gda.pl, PGP key available +
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:46 ` Bradley D. LaRonde
@ 2002-01-30 18:46 ` Bradley D. LaRonde
0 siblings, 0 replies; 15+ messages in thread
From: Bradley D. LaRonde @ 2002-01-30 18:46 UTC (permalink / raw)
To: Maciej W. Rozycki, Geoffrey Espin; +Cc: Steven J. Hill, linux-mips
I think --noinhibit-exec worked for me as a temporary measure until I
upgraded the kernel.
Regards,
Brad
----- Original Message -----
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
To: "Geoffrey Espin" <espin@idiom.com>
Cc: "Steven J. Hill" <sjhill@cotw.com>; <linux-mips@oss.sgi.com>
Sent: Wednesday, January 30, 2002 1:35 PM
Subject: Re: [PATCH] Compiler warnings and remove unused code....
> On Wed, 30 Jan 2002, Geoffrey Espin wrote:
>
> > 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.
>
> --
> + Maciej W. Rozycki, Technical University of Gdansk, Poland +
> +--------------------------------------------------------------+
> + e-mail: macro@ds2.pg.gda.pl, PGP key available +
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:23 ` Geoffrey Espin
2002-01-30 18:35 ` Maciej W. Rozycki
@ 2002-01-30 18:39 ` James Simmons
2002-01-30 18:44 ` Geoffrey Espin
2002-01-30 18:41 ` Daniel Jacobowitz
2 siblings, 1 reply; 15+ messages in thread
From: James Simmons @ 2002-01-30 18:39 UTC (permalink / raw)
To: Geoffrey Espin; +Cc: Steven J. Hill, linux-mips
> > 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).
I'm glad you tried it. I was tempted to apply it to CVS.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:39 ` James Simmons
@ 2002-01-30 18:44 ` Geoffrey Espin
2002-01-30 18:55 ` James Simmons
0 siblings, 1 reply; 15+ messages in thread
From: Geoffrey Espin @ 2002-01-30 18:44 UTC (permalink / raw)
To: James Simmons; +Cc: Steven J. Hill, linux-mips
James,
> > 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
--
espin@idiom.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:44 ` Geoffrey Espin
@ 2002-01-30 18:55 ` James Simmons
0 siblings, 0 replies; 15+ messages in thread
From: James Simmons @ 2002-01-30 18:55 UTC (permalink / raw)
To: Geoffrey Espin; +Cc: Steven J. Hill, linux-mips
> > > 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.
>
> Not sure what you mean by "apply it to CVS".
Place it in the SourceForge Mips Tree.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:23 ` Geoffrey Espin
2002-01-30 18:35 ` Maciej W. Rozycki
2002-01-30 18:39 ` James Simmons
@ 2002-01-30 18:41 ` Daniel Jacobowitz
2002-01-30 18:53 ` Geoffrey Espin
2 siblings, 1 reply; 15+ messages in thread
From: Daniel Jacobowitz @ 2002-01-30 18:41 UTC (permalink / raw)
To: Geoffrey Espin; +Cc: Steven J. Hill, linux-mips
On Wed, Jan 30, 2002 at 10:23:40AM -0800, Geoffrey Espin wrote:
> Steve,
>
> > 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
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
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:41 ` Daniel Jacobowitz
@ 2002-01-30 18:53 ` Geoffrey Espin
0 siblings, 0 replies; 15+ messages in thread
From: Geoffrey Espin @ 2002-01-30 18:53 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Steven J. Hill, linux-mips
> 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]
> 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
--
espin@idiom.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 17:29 [PATCH] Compiler warnings and remove unused code Steven J. Hill
2002-01-30 18:23 ` Geoffrey Espin
@ 2002-01-30 18:55 ` Maciej W. Rozycki
2002-01-30 19:13 ` Steven J. Hill
2002-01-30 19:15 ` Steven J. Hill
2 siblings, 1 reply; 15+ messages in thread
From: Maciej W. Rozycki @ 2002-01-30 18:55 UTC (permalink / raw)
To: Steven J. Hill; +Cc: linux-mips, ralf
On Wed, 30 Jan 2002, Steven J. Hill wrote:
> - 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()?
> +#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
> +}
> +
Any specific need to move it?
> - ret = KSEG1ADDR(ret);
> + ret = (void *) KSEG1ADDR(ret);
Hmm, KSEG1ADDR() should probably use typeof(), instead.
> printk(KERN_WARNING "Warning only %ldMB will be used.\n",
> - MAXMEM>>20);
> + (unsigned long) (MAXMEM>>20));
MAXMEM is int, how about "%d" instead?
> --- drivers/pci/pci.ids 3 Jan 2002 17:20:28 -0000 1.3
> +++ drivers/pci/pci.ids 30 Jan 2002 17:20:50 -0000
Are you sure it belongs here? Or is needed at all?
Otherwise OK, I think, unless I missed something.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 18:55 ` Maciej W. Rozycki
@ 2002-01-30 19:13 ` Steven J. Hill
2002-01-31 12:45 ` Maciej W. Rozycki
0 siblings, 1 reply; 15+ messages in thread
From: Steven J. Hill @ 2002-01-30 19:13 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: linux-mips, ralf
"Maciej W. Rozycki" wrote:
>
> On Wed, 30 Jan 2002, Steven J. Hill wrote:
>
> > - 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.
> > +#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
> > +}
> > +
>
> Any specific need to move it?
>
Yes. Eliminates a 'implicit declaration of register_irq_proc' warning.
> > - ret = KSEG1ADDR(ret);
> > + ret = (void *) KSEG1ADDR(ret);
>
> Hmm, KSEG1ADDR() should probably use typeof(), instead.
>
Fine.
> > printk(KERN_WARNING "Warning only %ldMB will be used.\n",
> > - MAXMEM>>20);
> > + (unsigned long) (MAXMEM>>20));
>
> MAXMEM is int, how about "%d" instead?
>
Fine.
> > --- drivers/pci/pci.ids 3 Jan 2002 17:20:28 -0000 1.3
> > +++ drivers/pci/pci.ids 30 Jan 2002 17:20:50 -0000
>
> 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
--
Steven J. Hill - Embedded SW Engineer
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 19:13 ` Steven J. Hill
@ 2002-01-31 12:45 ` Maciej W. Rozycki
0 siblings, 0 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2002-01-31 12:45 UTC (permalink / raw)
To: Steven J. Hill; +Cc: linux-mips, ralf
On Wed, 30 Jan 2002, Steven J. Hill wrote:
> > > --- drivers/pci/pci.ids 3 Jan 2002 17:20:28 -0000 1.3
> > > +++ drivers/pci/pci.ids 30 Jan 2002 17:20:50 -0000
> >
> > 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.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Compiler warnings and remove unused code....
2002-01-30 17:29 [PATCH] Compiler warnings and remove unused code Steven J. Hill
2002-01-30 18:23 ` Geoffrey Espin
2002-01-30 18:55 ` Maciej W. Rozycki
@ 2002-01-30 19:15 ` Steven J. Hill
2 siblings, 0 replies; 15+ messages in thread
From: Steven J. Hill @ 2002-01-30 19:15 UTC (permalink / raw)
To: linux-mips
"Steven J. Hill" wrote:
>
> 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
--
Steven J. Hill - Embedded SW Engineer
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2002-01-31 13:46 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-30 17:29 [PATCH] Compiler warnings and remove unused code Steven J. Hill
2002-01-30 18:23 ` Geoffrey Espin
2002-01-30 18:35 ` Maciej W. Rozycki
2002-01-30 18:39 ` Geoffrey Espin
2002-01-30 18:46 ` Bradley D. LaRonde
2002-01-30 18:46 ` Bradley D. LaRonde
2002-01-30 18:39 ` James Simmons
2002-01-30 18:44 ` Geoffrey Espin
2002-01-30 18:55 ` James Simmons
2002-01-30 18:41 ` Daniel Jacobowitz
2002-01-30 18:53 ` Geoffrey Espin
2002-01-30 18:55 ` Maciej W. Rozycki
2002-01-30 19:13 ` Steven J. Hill
2002-01-31 12:45 ` Maciej W. Rozycki
2002-01-30 19:15 ` Steven J. Hill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox