2002-12-05 10:47:19

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [0/8] fix warnings in mainline

Patch series vs. 2.5.50-bk as of Thu Dec 5 02:26:45 PST 2002
This patch series fixes various warnings encountered compiling
2.5.50-bk as of the time posted. Various driver etc. maintainers
cc:'d for proper acks etc.

These fixes have been pending for a while; hence Linus on the To:
line. Otherwise it's pure driver/etc. maintainer acks.

[0/8] warn-2.5.50-0 fix warnings in mainline
numerous warnings appear compiling mainling 2.5.50 kernels
[1/8] warn-2.5.50-hugetlbfs-1 fix hugetlbfs security.h problem
hugetlbfs wants security_inode_setattr(), which is an inline
defined in <linux/security.h>
[2/8] warn-2.5.50-serial-2 fix uninitialized quot in drivers/serial/core.c
quot needs to be a baud divisor; this sets it to something sane
so that things can proceed
[3/8] warn-2.5.50-suspend-3 fix duplicate decls in swsusp
swsusp conditionally declares software_suspend() as an inline
no-op; remove reboot.h extern declaration.
[4/8] warn-2.5.50-cyrix-4 remove unused cr0 in cyrix.c
cr0 is just not used here. Remove it.
[5/8] warn-2.5.50-starfire-5 fix printk() type warning in drivers/net/starfire.c
Cast to (u64) and use %Lx in all cases.
[6/8] warn-2.5.50-ioapic-6 fix mismatched function type in arch/i386/kernel/ioapic.c
the function needs to return int; give it a return type and
return 0 unconditionally from it (as it cannot fail)
[7/8] warn-2.5.50-tulip-7 fix printk() type warning in drivers/net/tulip/interrupt.c
Cast to (u64) and use %Lx in all cases.
[8/8] warn-2.5.50-floppy-8 fix unused function warning in drivers/block/floppy.c
unregister_devfs_entries() is only used in the #if MODULE
case; move it into #if MODULE so it doesn't affect non-modular


2002-12-05 10:47:21

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [7/8] fix printk() type warning in drivers/net/tulip/interrupt.c

Cast to u64 and always print as %Lx to prevent type clashes.
Jeff, this is yours to ack.

===== drivers/net/tulip/interrupt.c 1.14 vs edited =====
--- 1.14/drivers/net/tulip/interrupt.c Mon Oct 28 21:14:42 2002
+++ edited/drivers/net/tulip/interrupt.c Thu Dec 5 01:22:15 2002
@@ -194,10 +194,10 @@
if (tp->rx_buffers[entry].mapping !=
le32_to_cpu(tp->rx_ring[entry].buffer1)) {
printk(KERN_ERR "%s: Internal fault: The skbuff addresses "
- "do not match in tulip_rx: %08x vs. %08x %p / %p.\n",
+ "do not match in tulip_rx: %08x vs. %08Lx %p / %p.\n",
dev->name,
le32_to_cpu(tp->rx_ring[entry].buffer1),
- tp->rx_buffers[entry].mapping,
+ (u64)tp->rx_buffers[entry].mapping,
skb->head, temp);
}
#endif

2002-12-05 10:47:13

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [5/8] fix printk() type warning in drivers/net/starfire.c

Change the format to %Lx and cast to u64 unconditionally.
Jeff, this is yours to ack.

===== drivers/net/starfire.c 1.22 vs edited =====
--- 1.22/drivers/net/starfire.c Wed Nov 27 23:09:51 2002
+++ edited/drivers/net/starfire.c Thu Dec 5 01:15:06 2002
@@ -1847,15 +1847,15 @@

#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 %8.8Lx:\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 %8.8Lx -> %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",

2002-12-05 10:47:17

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [3/8] fix duplicate decls in swsusp

Remove the reboot.h declaration of swsusp functions that clash
with the no-op inline. Already acked by pavel.

===== include/linux/reboot.h 1.2 vs edited =====
--- 1.2/include/linux/reboot.h Thu May 2 17:21:36 2002
+++ edited/include/linux/reboot.h Thu Dec 5 01:05:34 2002
@@ -48,13 +48,6 @@
extern void machine_halt(void);
extern void machine_power_off(void);

-/*
- * Architecture-independent suspend facility
- */
-
-extern void software_suspend(void);
-extern unsigned char software_suspend_enabled;
-
#endif

#endif /* _LINUX_REBOOT_H */
===== kernel/sys.c 1.36 vs edited =====
--- 1.36/kernel/sys.c Wed Nov 27 15:13:29 2002
+++ edited/kernel/sys.c Thu Dec 5 01:06:10 2002
@@ -21,6 +21,7 @@
#include <linux/times.h>
#include <linux/security.h>
#include <linux/dcookies.h>
+#include <linux/suspend.h>

#include <asm/uaccess.h>
#include <asm/io.h>

2002-12-05 10:46:04

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [1/8] fix hugetlbfs security.h problem

Include <linux/security.h.> to get a definition of
security_inode_setattr() etc. I guess I ack this myself.

===== fs/hugetlbfs/inode.c 1.5 vs edited =====
--- 1.5/fs/hugetlbfs/inode.c Wed Nov 27 15:09:41 2002
+++ edited/fs/hugetlbfs/inode.c Thu Dec 5 00:46:58 2002
@@ -23,7 +23,7 @@
#include <linux/pagevec.h>
#include <linux/quotaops.h>
#include <linux/dnotify.h>
-
+#include <linux/security.h>
#include <asm/uaccess.h>

/* some random number */

2002-12-05 10:47:20

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [4/8] remove unused cr0 in cyrix.c

Remove cr0; the variable is unused. Hiroshi, this is yours to ack.

===== arch/i386/kernel/cpu/cyrix.c 1.6 vs edited =====
--- 1.6/arch/i386/kernel/cpu/cyrix.c Thu Nov 14 18:02:21 2002
+++ edited/arch/i386/kernel/cpu/cyrix.c Thu Dec 5 01:10:10 2002
@@ -170,7 +170,6 @@
{
unsigned long flags;
u8 ccr3, ccr4;
- unsigned long cr0;
local_irq_save(flags);

ccr3 = getCx86(CX86_CCR3);

2002-12-05 10:46:06

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [8/8] fix unused function warning in drivers/block/floppy.c

Move unregister_devfs_entries under the #ifdef MODULE section to
avoid the warning about unused functions. viro, this is your to ack.

===== drivers/block/floppy.c 1.63 vs edited =====
--- 1.63/drivers/block/floppy.c Tue Dec 3 10:14:11 2002
+++ edited/drivers/block/floppy.c Thu Dec 5 02:07:27 2002
@@ -3977,18 +3977,6 @@
}
}

-static void unregister_devfs_entries (int drive)
-{
- int i;
-
- if (UDP->cmos < NUMBER(default_drive_params)) {
- i = 0;
- do {
- devfs_remove("floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]);
- } while (table_sup[UDP->cmos][i++]);
- }
-}
-
/*
* Floppy Driver initialization
* =============================
@@ -4542,6 +4530,18 @@
#ifdef MODULE

char *floppy;
+
+static void unregister_devfs_entries (int drive)
+{
+ int i;
+
+ if (UDP->cmos < NUMBER(default_drive_params)) {
+ i = 0;
+ do {
+ devfs_remove("floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]);
+ } while (table_sup[UDP->cmos][i++]);
+ }
+}

static void __init parse_floppy_cfg_string(char *cfg)
{

2002-12-05 10:47:19

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [2/8] fix uninitialized quot in drivers/serial/core.c

Give quot a default value so it's initialized. rmk, this is yours
to ack.

===== drivers/serial/core.c 1.24 vs edited =====
--- 1.24/drivers/serial/core.c Sun Dec 1 08:37:25 2002
+++ edited/drivers/serial/core.c Thu Dec 5 00:59:44 2002
@@ -387,7 +387,7 @@
uart_get_divisor(struct uart_port *port, struct termios *termios,
struct termios *old_termios)
{
- unsigned int quot, try;
+ unsigned int quot = 0, try;

for (try = 0; try < 3; try ++) {
unsigned int baud;
@@ -416,7 +416,7 @@
termios->c_cflag |= B9600;
}

- return quot;
+ return quot ? quot : 1;
}

EXPORT_SYMBOL(uart_get_divisor);

2002-12-05 10:47:18

by William Lee Irwin III

[permalink] [raw]
Subject: [warnings] [6/8] fix mismatched function type in arch/i386/kernel/ioapic.c

Change the function return type so as to match the required initcall
prototype. Alan, this is yours to ack.

===== arch/i386/kernel/io_apic.c 1.33 vs edited =====
--- 1.33/arch/i386/kernel/io_apic.c Wed Nov 20 07:20:10 2002
+++ edited/arch/i386/kernel/io_apic.c Thu Dec 5 01:18:11 2002
@@ -1749,10 +1749,11 @@
* APIC bugs then we can allow the modify fast path
*/

-static void __init io_apic_bug_finalize(void)
+static int __init io_apic_bug_finalize(void)
{
if(sis_apic_bug == -1)
sis_apic_bug = 0;
+ return 0;
}

late_initcall(io_apic_bug_finalize);

2002-12-05 11:12:26

by Russell King

[permalink] [raw]
Subject: Re: [warnings] [2/8] fix uninitialized quot in drivers/serial/core.c

On Thu, Dec 05, 2002 at 02:52:59AM -0800, [email protected] wrote:
> Give quot a default value so it's initialized. rmk, this is yours
> to ack.

Why can't we get this obvious compiler bug fixed? I'd rather have
the compiler bug fixed rather than trying to work around the bogus
warning.

It's obvious that the loop:

for (try = 0; try < 3; try++)

is going to be executed at least once, which will initialise quot.

As for the second hunk, its correct in so far as it'll catch the case
where we can't even do 9600 baud. However, I think we should just
bound the lowest baud rate such that we can always do 9600 baud (and
therefore this function will never return zero.)

--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

2002-12-05 11:18:16

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [warnings] [2/8] fix uninitialized quot in drivers/serial/core.c

On Thu, Dec 05, 2002 at 02:52:59AM -0800, [email protected] wrote:
>> Give quot a default value so it's initialized. rmk, this is yours
>> to ack.

On Thu, Dec 05, 2002 at 11:19:13AM +0000, Russell King wrote:
> Why can't we get this obvious compiler bug fixed? I'd rather have
> the compiler bug fixed rather than trying to work around the bogus
> warning.

I'll start talking with rth and drow. I'm not 100% incompetent in
luserspace, but gcc is a world unto itself (and some damn dirty
code IMHO).


On Thu, Dec 05, 2002 at 11:19:13AM +0000, Russell King wrote:
> It's obvious that the loop:
> for (try = 0; try < 3; try++)
> is going to be executed at least once, which will initialise quot.
> As for the second hunk, its correct in so far as it'll catch the case
> where we can't even do 9600 baud. However, I think we should just
> bound the lowest baud rate such that we can always do 9600 baud (and
> therefore this function will never return zero.)

This is a compiler bug; the rest will follow from that. Also, the
sub-9600 baud case of the second hunk can be handled independently
from the first hunk. I'll break this out into its second hunk if it's
worth sending by itself, as you see fit.

Before any of this happens, I'll try it out on more modern gcc's.


Bill

2002-12-05 11:34:05

by Russell King

[permalink] [raw]
Subject: Re: [warnings] [2/8] fix uninitialized quot in drivers/serial/core.c

On Thu, Dec 05, 2002 at 03:25:39AM -0800, William Lee Irwin III wrote:
> Before any of this happens, I'll try it out on more modern gcc's.

Some more info before you report the bug to the gcc people - looking at
my kernel build logs from the past week, it seems to be a gcc 2.95.x
thing (maybe a 2.96 thing as well). It appears to be fixed in gcc 3.2.1.

I'm in favour of putting up with the incorrect warning produced by older
compilers.

--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

2002-12-05 11:34:21

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [warnings] [2/8] fix uninitialized quot in drivers/serial/core.c

On Thu, Dec 05, 2002 at 02:52:59AM -0800, [email protected] wrote:
>> Give quot a default value so it's initialized. rmk, this is yours
>> to ack.

On Thu, Dec 05, 2002 at 11:19:13AM +0000, Russell King wrote:
> Why can't we get this obvious compiler bug fixed? I'd rather have
> the compiler bug fixed rather than trying to work around the bogus
> warning.
> It's obvious that the loop:
> for (try = 0; try < 3; try++)
> is going to be executed at least once, which will initialise quot.
> As for the second hunk, its correct in so far as it'll catch the case
> where we can't even do 9600 baud. However, I think we should just
> bound the lowest baud rate such that we can always do 9600 baud (and
> therefore this function will never return zero.)


Linus, please count this as a NAK wrt. the serial changes in this set.
They'll be dealt with at the toolchain level.


Thanks,
Bill

2002-12-05 16:47:16

by Jeff Garzik

[permalink] [raw]
Subject: Re: [warnings] [5/8] fix printk() type warning in drivers/net/starfire.c

your net drivers patches look ok to me. I'll merge them in the next day
or so, if Linus does not.

2002-12-05 16:46:17

by Alan

[permalink] [raw]
Subject: Re: [warnings] [6/8] fix mismatched function type in arch/i386/kernel/ioapic.c

On Thu, 2002-12-05 at 10:52, [email protected] wrote:
> Change the function return type so as to match the required initcall
> prototype. Alan, this is yours to ack.

Already iny my tree - ack

2002-12-06 03:57:10

by Hiroshi Miura

[permalink] [raw]
Subject: Re: [warnings] [4/8] remove unused cr0 in cyrix.c


> Remove cr0; the variable is unused. Hiroshi, this is yours to ack.
>
> ===== arch/i386/kernel/cpu/cyrix.c 1.6 vs edited =====
> --- 1.6/arch/i386/kernel/cpu/cyrix.c Thu Nov 14 18:02:21 2002
> +++ edited/arch/i386/kernel/cpu/cyrix.c Thu Dec 5 01:10:10 2002
> @@ -170,7 +170,6 @@
> {
> unsigned long flags;
> u8 ccr3, ccr4;
> - unsigned long cr0;
> local_irq_save(flags);
>
> ccr3 = getCx86(CX86_CCR3);

obviously this looks ok to me.

--
Hiroshi Miura [email protected]