All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steven J. Hill" <sjhill@cotw.com>
To: linux-mips@oss.sgi.com
Cc: ralf@uni-koblenz.de
Subject: [PATCH] Compiler warnings and remove unused code....
Date: Wed, 30 Jan 2002 11:29:18 -0600	[thread overview]
Message-ID: <3C582D6E.F86FBFE7@cotw.com> (raw)

[-- 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
 {

             reply	other threads:[~2002-01-30 18:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-30 17:29 Steven J. Hill [this message]
2002-01-30 18:23 ` [PATCH] Compiler warnings and remove unused code 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C582D6E.F86FBFE7@cotw.com \
    --to=sjhill@cotw.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=ralf@uni-koblenz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.