All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] add printk KERN_ constants
@ 2005-10-28 20:15 Matthew Whitworth
  2005-10-28 20:18 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matthew Whitworth @ 2005-10-28 20:15 UTC (permalink / raw)
  To: kernel-janitors

Hi,

I'm just testing the water, here's my first patch. If that's ok,
there's a lot of things to fix in arch/sh.

Description:
printk() calls should include appropriate KERN_* constant.

Signed-off-by: Matthew Whitworth <mwhitworth@gmail.com>

diff -uprN linux-2.6.14/arch/sh/mm/fault-nommu.c mod/arch/sh/mm/fault-nommu.c
--- linux-2.6.14/arch/sh/mm/fault-nommu.c       2005-10-28
01:02:08.000000000 +0100
+++ mod/arch/sh/mm/fault-nommu.c        2005-10-28 20:09:18.000000000 +0100
@@ -59,7 +59,7 @@ asmlinkage void do_page_fault(struct pt_
               printk(KERN_ALERT "Unable to handle kernel paging request");
       }

-       printk(" at virtual address %08lx\n", address);
+       printk(KERN_ALERT " at virtual address %08lx\n", address);
       printk(KERN_ALERT "pc = %08lx\n", regs->pc);

       die("Oops", regs, writeaccess);
diff -uprN linux-2.6.14/arch/sh/mm/fault.c mod/arch/sh/mm/fault.c
--- linux-2.6.14/arch/sh/mm/fault.c     2005-10-28 01:02:08.000000000 +0100
+++ mod/arch/sh/mm/fault.c      2005-10-28 20:12:33.000000000 +0100
@@ -136,7 +136,7 @@ no_context:
               printk(KERN_ALERT "Unable to handle kernel NULL pointer
dereference");
       else
               printk(KERN_ALERT "Unable to handle kernel paging request");
-       printk(" at virtual address %08lx\n", address);
+       printk(KERN_ALERT " at virtual address %08lx\n", address);
       printk(KERN_ALERT "pc = %08lx\n", regs->pc);
       asm volatile("mov.l     %1, %0"
                    : "=r" (page)
@@ -165,7 +165,7 @@ out_of_memory:
               down_read(&mm->mmap_sem);
               goto survive;
       }
-       printk("VM: killing process %s\n", tsk->comm);
+       printk(KERN_ALERT "VM: killing process %s\n", tsk->comm);
       if (user_mode(regs))
               do_exit(SIGKILL);
       goto no_context;

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [KJ] [PATCH] add printk KERN_ constants
  2005-10-28 20:15 [KJ] [PATCH] add printk KERN_ constants Matthew Whitworth
@ 2005-10-28 20:18 ` Greg KH
  2005-10-28 20:30 ` Randy.Dunlap
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2005-10-28 20:18 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 971 bytes --]

On Fri, Oct 28, 2005 at 09:15:28PM +0100, Matthew Whitworth wrote:
> Hi,
> 
> I'm just testing the water, here's my first patch. If that's ok,
> there's a lot of things to fix in arch/sh.
> 
> Description:
> printk() calls should include appropriate KERN_* constant.
> 
> Signed-off-by: Matthew Whitworth <mwhitworth@gmail.com>
> 
> diff -uprN linux-2.6.14/arch/sh/mm/fault-nommu.c mod/arch/sh/mm/fault-nommu.c
> --- linux-2.6.14/arch/sh/mm/fault-nommu.c       2005-10-28
> 01:02:08.000000000 +0100

Patch is line-wrapped :(

> +++ mod/arch/sh/mm/fault-nommu.c        2005-10-28 20:09:18.000000000 +0100
> @@ -59,7 +59,7 @@ asmlinkage void do_page_fault(struct pt_
>                printk(KERN_ALERT "Unable to handle kernel paging request");
>        }
> 
> -       printk(" at virtual address %08lx\n", address);
> +       printk(KERN_ALERT " at virtual address %08lx\n", address);

The tabs were all eaten by your email client :(

please try again.

thanks,

greg k-h

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [KJ] [PATCH] add printk KERN_ constants
  2005-10-28 20:15 [KJ] [PATCH] add printk KERN_ constants Matthew Whitworth
  2005-10-28 20:18 ` Greg KH
@ 2005-10-28 20:30 ` Randy.Dunlap
  2005-10-28 20:32 ` Matthew Whitworth
  2005-10-28 20:50 ` Alexey Dobriyan
  3 siblings, 0 replies; 5+ messages in thread
From: Randy.Dunlap @ 2005-10-28 20:30 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2285 bytes --]

On Fri, 28 Oct 2005, Matthew Whitworth wrote:

> Hi,
>
> I'm just testing the water, here's my first patch. If that's ok,
> there's a lot of things to fix in arch/sh.
>
> Description:
> printk() calls should include appropriate KERN_* constant.

but KERN_* constants only go at the beginning of a printed line
and some (or all) of these are "continuation" lines, which
don't get the KERN* constants.
I.e.,
	printk(KERN_DEBUG "beginning of a line"); // no newline
	printk("more of the same line");
	printk("end of the line\n");
is correct.  Don't add to these.

>
> Signed-off-by: Matthew Whitworth <mwhitworth@gmail.com>
>
> diff -uprN linux-2.6.14/arch/sh/mm/fault-nommu.c mod/arch/sh/mm/fault-nommu.c
> --- linux-2.6.14/arch/sh/mm/fault-nommu.c       2005-10-28
> 01:02:08.000000000 +0100
> +++ mod/arch/sh/mm/fault-nommu.c        2005-10-28 20:09:18.000000000 +0100
> @@ -59,7 +59,7 @@ asmlinkage void do_page_fault(struct pt_
>                printk(KERN_ALERT "Unable to handle kernel paging request");
>        }
>
> -       printk(" at virtual address %08lx\n", address);
> +       printk(KERN_ALERT " at virtual address %08lx\n", address);
>        printk(KERN_ALERT "pc = %08lx\n", regs->pc);
>
>        die("Oops", regs, writeaccess);
> diff -uprN linux-2.6.14/arch/sh/mm/fault.c mod/arch/sh/mm/fault.c
> --- linux-2.6.14/arch/sh/mm/fault.c     2005-10-28 01:02:08.000000000 +0100
> +++ mod/arch/sh/mm/fault.c      2005-10-28 20:12:33.000000000 +0100
> @@ -136,7 +136,7 @@ no_context:
>                printk(KERN_ALERT "Unable to handle kernel NULL pointer
> dereference");
>        else
>                printk(KERN_ALERT "Unable to handle kernel paging request");
> -       printk(" at virtual address %08lx\n", address);
> +       printk(KERN_ALERT " at virtual address %08lx\n", address);
>        printk(KERN_ALERT "pc = %08lx\n", regs->pc);
>        asm volatile("mov.l     %1, %0"
>                     : "=r" (page)
> @@ -165,7 +165,7 @@ out_of_memory:
>                down_read(&mm->mmap_sem);
>                goto survive;
>        }
> -       printk("VM: killing process %s\n", tsk->comm);
> +       printk(KERN_ALERT "VM: killing process %s\n", tsk->comm);
>        if (user_mode(regs))
>                do_exit(SIGKILL);
>        goto no_context;

-- 
~Randy

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [KJ] [PATCH] add printk KERN_ constants
  2005-10-28 20:15 [KJ] [PATCH] add printk KERN_ constants Matthew Whitworth
  2005-10-28 20:18 ` Greg KH
  2005-10-28 20:30 ` Randy.Dunlap
@ 2005-10-28 20:32 ` Matthew Whitworth
  2005-10-28 20:50 ` Alexey Dobriyan
  3 siblings, 0 replies; 5+ messages in thread
From: Matthew Whitworth @ 2005-10-28 20:32 UTC (permalink / raw)
  To: kernel-janitors

Ok, I didn't know that. Thanks for the information, and I'll try to
get my word-wrapping sorted out.

On 10/28/05, Randy.Dunlap <rdunlap@xenotime.net> wrote:
> On Fri, 28 Oct 2005, Matthew Whitworth wrote:
>
> > Hi,
> >
> > I'm just testing the water, here's my first patch. If that's ok,
> > there's a lot of things to fix in arch/sh.
> >
> > Description:
> > printk() calls should include appropriate KERN_* constant.
>
> but KERN_* constants only go at the beginning of a printed line
> and some (or all) of these are "continuation" lines, which
> don't get the KERN* constants.
> I.e.,
>         printk(KERN_DEBUG "beginning of a line"); // no newline
>         printk("more of the same line");
>         printk("end of the line\n");
> is correct.  Don't add to these.
>
> >
> > Signed-off-by: Matthew Whitworth <mwhitworth@gmail.com>
> >
> > diff -uprN linux-2.6.14/arch/sh/mm/fault-nommu.c mod/arch/sh/mm/fault-nommu.c
> > --- linux-2.6.14/arch/sh/mm/fault-nommu.c       2005-10-28
> > 01:02:08.000000000 +0100
> > +++ mod/arch/sh/mm/fault-nommu.c        2005-10-28 20:09:18.000000000 +0100
> > @@ -59,7 +59,7 @@ asmlinkage void do_page_fault(struct pt_
> >                printk(KERN_ALERT "Unable to handle kernel paging request");
> >        }
> >
> > -       printk(" at virtual address %08lx\n", address);
> > +       printk(KERN_ALERT " at virtual address %08lx\n", address);
> >        printk(KERN_ALERT "pc = %08lx\n", regs->pc);
> >
> >        die("Oops", regs, writeaccess);
> > diff -uprN linux-2.6.14/arch/sh/mm/fault.c mod/arch/sh/mm/fault.c
> > --- linux-2.6.14/arch/sh/mm/fault.c     2005-10-28 01:02:08.000000000 +0100
> > +++ mod/arch/sh/mm/fault.c      2005-10-28 20:12:33.000000000 +0100
> > @@ -136,7 +136,7 @@ no_context:
> >                printk(KERN_ALERT "Unable to handle kernel NULL pointer
> > dereference");
> >        else
> >                printk(KERN_ALERT "Unable to handle kernel paging request");
> > -       printk(" at virtual address %08lx\n", address);
> > +       printk(KERN_ALERT " at virtual address %08lx\n", address);
> >        printk(KERN_ALERT "pc = %08lx\n", regs->pc);
> >        asm volatile("mov.l     %1, %0"
> >                     : "=r" (page)
> > @@ -165,7 +165,7 @@ out_of_memory:
> >                down_read(&mm->mmap_sem);
> >                goto survive;
> >        }
> > -       printk("VM: killing process %s\n", tsk->comm);
> > +       printk(KERN_ALERT "VM: killing process %s\n", tsk->comm);
> >        if (user_mode(regs))
> >                do_exit(SIGKILL);
> >        goto no_context;
>
> --
> ~Randy
>

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [KJ] [PATCH] add printk KERN_ constants
  2005-10-28 20:15 [KJ] [PATCH] add printk KERN_ constants Matthew Whitworth
                   ` (2 preceding siblings ...)
  2005-10-28 20:32 ` Matthew Whitworth
@ 2005-10-28 20:50 ` Alexey Dobriyan
  3 siblings, 0 replies; 5+ messages in thread
From: Alexey Dobriyan @ 2005-10-28 20:50 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

On Fri, Oct 28, 2005 at 09:15:28PM +0100, Matthew Whitworth wrote:
> --- linux-2.6.14/arch/sh/mm/fault-nommu.c
> +++ mod/arch/sh/mm/fault-nommu.c
> @@ -59,7 +59,7 @@ asmlinkage void do_page_fault(struct pt_
>                printk(KERN_ALERT "Unable to handle kernel paging request");
>        }
>
> -       printk(" at virtual address %08lx\n", address);
> +       printk(KERN_ALERT " at virtual address %08lx\n", address);

Obviously wrong. This printk is a continuation of

	"Unable to handle kernel paging request"

printk and one before it. You should do nothing in this case.

Not every printk() should start with KERN_*. TODO explicitly says:

	- printk() calls should include appropriate KERN_* constant (of
	  course only at beginning of lines).

At the beginning. "at virtual address" is not at the beggining.

> --- linux-2.6.14/arch/sh/mm/fault.c
> +++ mod/arch/sh/mm/fault.c
> @@ -136,7 +136,7 @@ no_context:
>                printk(KERN_ALERT "Unable to handle kernel NULL pointer
> dereference");
>        else
>                printk(KERN_ALERT "Unable to handle kernel paging request");
> -       printk(" at virtual address %08lx\n", address);
> +       printk(KERN_ALERT " at virtual address %08lx\n", address);

Double check your arch/sh/* patchbomb.


[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-10-28 20:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-28 20:15 [KJ] [PATCH] add printk KERN_ constants Matthew Whitworth
2005-10-28 20:18 ` Greg KH
2005-10-28 20:30 ` Randy.Dunlap
2005-10-28 20:32 ` Matthew Whitworth
2005-10-28 20:50 ` Alexey Dobriyan

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.