Skip to contentSkip to conversation

Fix 4 compile time warnings in 2.5.53

PATCH In review Martin J. Bligh 2 participants 3 messages Dec 24, 2002

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix 4 compile time warnings in 2.5.53

Fix the following warnings:

drivers/serial/core.c: In function `uart_get_divisor':
drivers/serial/core.c:390: warning: quot' might be used uninitialized in this function net/ipv4/route.c: In function rt_cache_seq_stop':
net/ipv4/route.c:279: warning: unused variable `st'
drivers/net/starfire.c: In function `netdev_close':
drivers/net/starfire.c:1851: warning: unsigned int format, different type arg (arg 2) drivers/net/starfire.c:1858: warning: unsigned int format, different type arg (arg 2) arch/i386/kernel/smpboot.c:691: warning: `wakeup_secondary_via_INIT' defined but not used

My build is now eerily quiet.

M.

arch/i386/kernel/smpboot.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude virgin/arch/i386/kernel/smpboot.c fix_numaq_warning/arch/i386/kernel/smpboot.c
@@ -596,6 +596,8 @@ static inline void inquire_remote_apic(i

}
#endif

+#ifdef CONFIG_X86_NUMAQ
+
static int __init wakeup_secondary_via_NMI(int logical_apicid) /*
* Poke the other CPU in the eye to wake it up. Remember that the normal
@@ -644,6 +646,8 @@ static int __init wakeup_secondary_via_N

	return (send_status | accept_status);
}

+#else /* ! CONFIG_X86_NUMAQ */
+
static int __init wakeup_secondary_via_INIT(int phys_apicid, unsigned long start_eip)

{
	unsigned long send_status = 0, accept_status = 0;

@@ -766,6 +770,8 @@ static int __init wakeup_secondary_via_I

	return (send_status | accept_status);
}

+
+#endif /* CONFIG_X86_NUMAQ */

extern unsigned long cpu_initialized;

net/ipv4/route.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude virgin/net/ipv4/route.c fix_rtcache_warning/net/ipv4/route.c
@@ -275,11 +275,8 @@ static void *rt_cache_seq_next(struct se
 

static void rt_cache_seq_stop(struct seq_file *seq, void *v) {
- if (v && v != (void *)1) {
- struct rt_cache_iter_state *st = seq->private;
-
+ if (v && v != (void *)1)

		rcu_read_unlock();

- }
}

static int rt_cache_seq_show(struct seq_file *seq, void *v)

drivers/serial/core.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude virgin/drivers/serial/core.c fix_serial_warning/drivers/serial/core.c
@@ -396,7 +396,7 @@ uart_get_divisor(struct uart_port *port,
		baud = uart_get_baud_rate(port, termios);
		quot = uart_calculate_quot(port, baud);
		if (quot)

- break;
+ return quot;

		/*
		 * Oops, the quotient was zero.  Try again with
drivers/net/starfire.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude virgin/drivers/net/starfire.c fix_starfire_warning/drivers/net/starfire.c
@@ -1847,15 +1847,15 @@ static int netdev_close(struct net_devic
 
#ifdef __i386__
	if (debug > 2) {
-		printk("\n"KERN_DEBUG"  Tx ring at %8.8x:\n",
-			   np->tx_ring_dma);
+		printk("\n"KERN_DEBUG"  Tx ring at %9.9Lx:\n",
+			   (u64) np->tx_ring_dma);
		for (i = 0; i < 8 /* TX_RING_SIZE is huge! */; i++)
			printk(KERN_DEBUG " #%d desc. %8.8x %8.8x -> %8.8x.\n",
			       i, le32_to_cpu(np->tx_ring[i].status),
			       le32_to_cpu(np->tx_ring[i].first_addr),
			       le32_to_cpu(np->tx_done_q[i].status));
-		printk(KERN_DEBUG "  Rx ring at %8.8x -> %p:\n",
-		       np->rx_ring_dma, np->rx_done_q);
+		printk(KERN_DEBUG "  Rx ring at %9.9Lx -> %p:\n",
+		       (u64) np->rx_ring_dma, np->rx_done_q);
		if (np->rx_done_q)
			for (i = 0; i < 8 /* RX_RING_SIZE */; i++) {
				printk(KERN_DEBUG " #%d desc. %8.8x -> %8.8x\n",
#1 lore raw
Quoted 4 lines · Martin J. Bligh

Fix the following warnings:
drivers/serial/core.c: In function `uart_get_divisor':
drivers/serial/core.c:390: warning: `quot' might be used uninitialized in this function

This is a (harmless) toolchain problem. Upgrading compilers (or patching your current compiler) fixes it. I've posted a "fix" for this before.

Quoted 2 lines · Martin J. Bligh

net/ipv4/route.c: In function `rt_cache_seq_stop':
net/ipv4/route.c:279: warning: unused variable `st'

Fair enough.

Quoted 5 lines · Martin J. Bligh

drivers/net/starfire.c: In function `netdev_close':
drivers/net/starfire.c:1851: warning: unsigned int format, different type arg (arg 2)
drivers/net/starfire.c:1858: warning: unsigned int format, different type arg (arg 2)

Hmm, I thought I got this one into jgarzik's tree. I posted a fix for this one too.

Quoted 3 lines · Martin J. Bligh

arch/i386/kernel/smpboot.c:691: warning: `wakeup_secondary_via_INIT' defined but not used
My build is now eerily quiet.

This one's all you. =)

Bill

#2 lore raw
Quoted 6 lines
Quoted 3 lines

drivers/serial/core.c: In function `uart_get_divisor':
drivers/serial/core.c:390: warning: `quot' might be used uninitialized in this function

This is a (harmless) toolchain problem. Upgrading compilers (or patching your current compiler) fixes it. I've posted a "fix" for this before.

I refuse to upgrade the compiler on every machine in the lab from standard Debian woody to fix one stupid compiler error. This is a completely harmless substitution that makes the error go away. We don't live in a theoretical utopia.

M.