All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] janitoring printk with no KERN_ constants, kill all defaults?
@ 2004-10-15 15:44 ` Daniele Pizzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Daniele Pizzoni @ 2004-10-15 14:48 UTC (permalink / raw)
  To: lkml, kernel-janitors; +Cc: pazke

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

I'm investigating this (from the kernel janitors TODO list):

------------------------------------------------------------------------
From: Andrey Panin <pazke at orbita dot don dot sitek dot net>

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

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

printk ends up using the default KERN_WARNING constant when no costant
is explicitly specified; the default is changeable. So a printk with
_no_ constant specified means "use the current default" and could be,
maybe in some cases only, a developer choice.

I ask, what rationale there is behind checking all printks to include
the "appropriate" constant? Should then we make printk fail when called
without KERN_ constant? Or can I force with a sed script all defaulted
printk to KERN_WARNING?

I'm looking for advice, or a pointer to an appropriate thread of the
lkml archives.

Thanks
Daniele Pizzoni <auouo@tin.it>



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

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

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

* janitoring printk with no KERN_ constants, kill all defaults?
@ 2004-10-15 15:44 ` Daniele Pizzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Daniele Pizzoni @ 2004-10-15 15:44 UTC (permalink / raw)
  To: lkml, kernel-janitors; +Cc: pazke

I'm investigating this (from the kernel janitors TODO list):

------------------------------------------------------------------------
From: Andrey Panin <pazke at orbita dot don dot sitek dot net>

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

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

printk ends up using the default KERN_WARNING constant when no costant
is explicitly specified; the default is changeable. So a printk with
_no_ constant specified means "use the current default" and could be,
maybe in some cases only, a developer choice.

I ask, what rationale there is behind checking all printks to include
the "appropriate" constant? Should then we make printk fail when called
without KERN_ constant? Or can I force with a sed script all defaulted
printk to KERN_WARNING?

I'm looking for advice, or a pointer to an appropriate thread of the
lkml archives.

Thanks
Daniele Pizzoni <auouo@tin.it>



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

* [KJ] Re: janitoring printk with no KERN_ constants,
  2004-10-15 15:44 ` Daniele Pizzoni
@ 2004-10-15 15:46   ` Dave Jones
  -1 siblings, 0 replies; 7+ messages in thread
From: Dave Jones @ 2004-10-15 15:46 UTC (permalink / raw)
  To: Daniele Pizzoni; +Cc: lkml, kernel-janitors, pazke

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

On Fri, Oct 15, 2004 at 05:44:59PM +0200, Daniele Pizzoni wrote:

 > I ask, what rationale there is behind checking all printks to include
 > the "appropriate" constant? Should then we make printk fail when called
 > without KERN_ constant? Or can I force with a sed script all defaulted
 > printk to KERN_WARNING?

No. Consider this..

	printk (KERN_INFO "blah blah ");
	if (foo)
		printk ("%s", stringptr);
	else
		printk ("%d", number);
	printk ("\n");

There's nothing wrong with any of those printk's, so you
cannot do the checks you mention above.

		Dave


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

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

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

* Re: janitoring printk with no KERN_ constants, kill all defaults?
@ 2004-10-15 15:46   ` Dave Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Dave Jones @ 2004-10-15 15:46 UTC (permalink / raw)
  To: Daniele Pizzoni; +Cc: lkml, kernel-janitors, pazke

On Fri, Oct 15, 2004 at 05:44:59PM +0200, Daniele Pizzoni wrote:

 > I ask, what rationale there is behind checking all printks to include
 > the "appropriate" constant? Should then we make printk fail when called
 > without KERN_ constant? Or can I force with a sed script all defaulted
 > printk to KERN_WARNING?

No. Consider this..

	printk (KERN_INFO "blah blah ");
	if (foo)
		printk ("%s", stringptr);
	else
		printk ("%d", number);
	printk ("\n");

There's nothing wrong with any of those printk's, so you
cannot do the checks you mention above.

		Dave


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

* Re: [KJ] janitoring printk with no KERN_ constants, kill all defaults?
  2004-10-15 15:44 ` Daniele Pizzoni
@ 2004-10-15 16:17   ` Nishanth Aravamudan
  -1 siblings, 0 replies; 7+ messages in thread
From: Nishanth Aravamudan @ 2004-10-15 16:17 UTC (permalink / raw)
  To: Daniele Pizzoni; +Cc: lkml, kernel-janitors, pazke

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

On Fri, Oct 15, 2004 at 05:44:59PM +0200, Daniele Pizzoni wrote:
> I'm investigating this (from the kernel janitors TODO list):

<snip>

> I ask, what rationale there is behind checking all printks to include
> the "appropriate" constant? Should then we make printk fail when called
> without KERN_ constant? Or can I force with a sed script all defaulted
> printk to KERN_WARNING?

I think the rationale is to compare the comments from linux/kernel.h for
the KERN_* definitions to their usage in the code and make sure they
correspond accordingly, e.g. KERN_EMERG is only used if the system is
actually unusable.

Hope that helps,
Nish

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

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

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

* Re: [KJ] janitoring printk with no KERN_ constants, kill all defaults?
@ 2004-10-15 16:17   ` Nishanth Aravamudan
  0 siblings, 0 replies; 7+ messages in thread
From: Nishanth Aravamudan @ 2004-10-15 16:17 UTC (permalink / raw)
  To: Daniele Pizzoni; +Cc: lkml, kernel-janitors, pazke

On Fri, Oct 15, 2004 at 05:44:59PM +0200, Daniele Pizzoni wrote:
> I'm investigating this (from the kernel janitors TODO list):

<snip>

> I ask, what rationale there is behind checking all printks to include
> the "appropriate" constant? Should then we make printk fail when called
> without KERN_ constant? Or can I force with a sed script all defaulted
> printk to KERN_WARNING?

I think the rationale is to compare the comments from linux/kernel.h for
the KERN_* definitions to their usage in the code and make sure they
correspond accordingly, e.g. KERN_EMERG is only used if the system is
actually unusable.

Hope that helps,
Nish

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

* Re: janitoring printk with no KERN_ constants, kill all defaults?
  2004-10-15 15:46   ` janitoring printk with no KERN_ constants, kill all defaults? Dave Jones
  (?)
@ 2004-10-15 17:20   ` Daniele Pizzoni
  -1 siblings, 0 replies; 7+ messages in thread
From: Daniele Pizzoni @ 2004-10-15 17:20 UTC (permalink / raw)
  To: Dave Jones; +Cc: lkml

On ven, 2004-10-15 at 17:46, Dave Jones wrote:
> On Fri, Oct 15, 2004 at 05:44:59PM +0200, Daniele Pizzoni wrote:
> 
>  > I ask, what rationale there is behind checking all printks to include
>  > the "appropriate" constant? Should then we make printk fail when called
>  > without KERN_ constant? Or can I force with a sed script all defaulted
>  > printk to KERN_WARNING?
> 
> No. Consider this..
> 
> 	printk (KERN_INFO "blah blah ");
> 	if (foo)
> 		printk ("%s", stringptr);
> 	else
> 		printk ("%d", number);
> 	printk ("\n");
> 
> There's nothing wrong with any of those printk's, so you
> cannot do the checks you mention above.

Let me understand... You mean that we should check printk constants for
_consistency_ in their context (that is: for buggish printk code). So
printk without KERN_* constant are not an issue (and the janitors TODO
list entry is a bit puzzling)?

Thanks for helping
Daniele



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

end of thread, other threads:[~2004-10-15 16:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-15 14:48 [KJ] janitoring printk with no KERN_ constants, kill all defaults? Daniele Pizzoni
2004-10-15 15:44 ` Daniele Pizzoni
2004-10-15 15:46 ` [KJ] Re: janitoring printk with no KERN_ constants, Dave Jones
2004-10-15 15:46   ` janitoring printk with no KERN_ constants, kill all defaults? Dave Jones
2004-10-15 17:20   ` Daniele Pizzoni
2004-10-15 16:17 ` [KJ] " Nishanth Aravamudan
2004-10-15 16:17   ` Nishanth Aravamudan

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.