2003-03-13 16:31:27

by Daniele Venzano

[permalink] [raw]
Subject: [PATCH] add prink KERN_* suffixes

Looking at the Kernel Janitor TODO list I saw this:
------------------------------------------------------------------------
From: Andrey Panin <pazke at orbita dot don dot sitek dot net>

- check printk() calls (should include appropriate KERN_* constant).

------------------------------------------------------------------------

The following three patches add KERN_* prefixes to all printk() in
3c509.c 8390.c hp.c and slhc.c

I don't know if I got the priorities right, so some feedback is
appreciated...

The patches are against 2.5.64 and are also available at:
http://digilander.libero.it/webvenza/kernel_patches.html

--
----------------------------------------
Daniele Venzano
Web: http://digilander.iol.it/webvenza/


Attachments:
(No filename) (0.00 B)
(No filename) (189.00 B)
Download all attachments

2003-03-13 17:11:49

by Andreas Schwab

[permalink] [raw]
Subject: Re: [PATCH] add prink KERN_* suffixes

Daniele Venzano <[email protected]> writes:

|> diff -urN -X /home/venza/kernel/dontdiff linux-2.5.64/drivers/net/3c509.c linux-2.5.64-work/drivers/net/3c509.c
|> --- linux-2.5.64/drivers/net/3c509.c 2003-03-06 11:41:18.000000000 +0100
|> +++ linux-2.5.64-work/drivers/net/3c509.c 2003-03-13 12:28:39.000000000 +0100
|> @@ -316,14 +316,14 @@
|>
|> {
|> const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};
|> - printk("%s: 3c5x9 at %#3.3lx, %s port, address ",
|> + printk(KERN_INFO "%s: 3c5x9 at %#3.3lx, %s port, address ",
|> dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)]);
|> }
|>
|> /* Read in the station address. */
|> for (i = 0; i < 6; i++)
|> - printk(" %2.2x", dev->dev_addr[i]);
|> - printk(", IRQ %d.\n", dev->irq);
|> + printk(KERN_INFO " %2.2x", dev->dev_addr[i]);
|> + printk(KERN_INFO ", IRQ %d.\n", dev->irq);

This is wrong, a KERN_* prefix is only recognized after a newline.

Andreas.

--
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 N?rnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."

2003-03-13 21:29:45

by Robert Love

[permalink] [raw]
Subject: Re: [PATCH] add prink KERN_* suffixes

On Thu, 2003-03-13 at 11:41, Daniele Venzano wrote:
> /* Read in the station address. */
> for (i = 0; i < 6; i++)
> - printk(" %2.2x", dev->dev_addr[i]);
> - printk(", IRQ %d.\n", dev->irq);
> + printk(KERN_INFO " %2.2x", dev->dev_addr[i]);
> + printk(KERN_INFO ", IRQ %d.\n", dev->irq);


The loglevels only work after a newline.

What you can do is printk() the loglevel before the for loop. Or just
leave this one alone.

Robert Love

2003-03-14 18:35:24

by Daniele Venzano

[permalink] [raw]
Subject: Re: [PATCH] add prink KERN_* suffixes

> The loglevels only work after a newline.
That's sane... I could think to it by myself in the first place. :-(

Here there are new patches, checked out for the newline stuff, always
against 2.5.64 and modifing the following files from drivers/net/:
3c509.c (first patch)
8390.c (second patch)
hp.c and hldc.c (third patch)

I also made similar work on 3c503.c, but I had to run it through indent
before, so the patch is big (~35k uncompressed). It can be found (with
all the others) at:

http://digilander.libero.it/webvenza/kernel_patches.html

--
----------------------------------------
Daniele Venzano
Web: http://digilander.iol.it/webvenza/


Attachments:
(No filename) (0.00 B)
(No filename) (189.00 B)
Download all attachments