* [PATCH 1/4] lib/debugobjects.c: convert printk to pr_foo()
@ 2014-05-24 13:06 Fabian Frederick
2014-05-24 21:53 ` Josh Triplett
0 siblings, 1 reply; 6+ messages in thread
From: Fabian Frederick @ 2014-05-24 13:06 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, Josh Triplett, Andrew Morton
Convert all except KERN_DEBUG
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
lib/debugobjects.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index e0731c3..ea4c737 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -218,7 +218,7 @@ static void debug_objects_oom(void)
unsigned long flags;
int i;
- printk(KERN_WARNING "ODEBUG: Out of memory. ODEBUG disabled\n");
+ pr_warn("ODEBUG: Out of memory. ODEBUG disabled\n");
for (i = 0; i < ODEBUG_HASH_SIZE; i++, db++) {
raw_spin_lock_irqsave(&db->lock, flags);
@@ -292,11 +292,9 @@ static void debug_object_is_on_stack(void *addr, int onstack)
limit++;
if (is_on_stack)
- printk(KERN_WARNING
- "ODEBUG: object is on stack, but not annotated\n");
+ pr_warn("ODEBUG: object is on stack, but not annotated\n");
else
- printk(KERN_WARNING
- "ODEBUG: object is not on stack, but annotated\n");
+ pr_warn("ODEBUG: object is not on stack, but annotated\n");
WARN_ON(1);
}
@@ -985,7 +983,7 @@ static void __init debug_objects_selftest(void)
if (check_results(&obj, ODEBUG_STATE_NONE, ++fixups, ++warnings))
goto out;
#endif
- printk(KERN_INFO "ODEBUG: selftest passed\n");
+ pr_info("ODEBUG: selftest passed\n");
out:
debug_objects_fixups = oldfixups;
@@ -1090,7 +1088,7 @@ void __init debug_objects_mem_init(void)
debug_objects_enabled = 0;
if (obj_cache)
kmem_cache_destroy(obj_cache);
- printk(KERN_WARNING "ODEBUG: out of memory.\n");
+ pr_warn("ODEBUG: out of memory.\n");
} else
debug_objects_selftest();
}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/4] lib/debugobjects.c: convert printk to pr_foo()
2014-05-24 13:06 [PATCH 1/4] lib/debugobjects.c: convert printk to pr_foo() Fabian Frederick
@ 2014-05-24 21:53 ` Josh Triplett
2014-05-25 3:18 ` Fabian Frederick
0 siblings, 1 reply; 6+ messages in thread
From: Josh Triplett @ 2014-05-24 21:53 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Andrew Morton
On Sat, May 24, 2014 at 03:06:08PM +0200, Fabian Frederick wrote:
> Convert all except KERN_DEBUG
Why not KERN_DEBUG?
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> lib/debugobjects.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/lib/debugobjects.c b/lib/debugobjects.c
> index e0731c3..ea4c737 100644
> --- a/lib/debugobjects.c
> +++ b/lib/debugobjects.c
> @@ -218,7 +218,7 @@ static void debug_objects_oom(void)
> unsigned long flags;
> int i;
>
> - printk(KERN_WARNING "ODEBUG: Out of memory. ODEBUG disabled\n");
> + pr_warn("ODEBUG: Out of memory. ODEBUG disabled\n");
>
> for (i = 0; i < ODEBUG_HASH_SIZE; i++, db++) {
> raw_spin_lock_irqsave(&db->lock, flags);
> @@ -292,11 +292,9 @@ static void debug_object_is_on_stack(void *addr, int onstack)
>
> limit++;
> if (is_on_stack)
> - printk(KERN_WARNING
> - "ODEBUG: object is on stack, but not annotated\n");
> + pr_warn("ODEBUG: object is on stack, but not annotated\n");
> else
> - printk(KERN_WARNING
> - "ODEBUG: object is not on stack, but annotated\n");
> + pr_warn("ODEBUG: object is not on stack, but annotated\n");
> WARN_ON(1);
> }
>
> @@ -985,7 +983,7 @@ static void __init debug_objects_selftest(void)
> if (check_results(&obj, ODEBUG_STATE_NONE, ++fixups, ++warnings))
> goto out;
> #endif
> - printk(KERN_INFO "ODEBUG: selftest passed\n");
> + pr_info("ODEBUG: selftest passed\n");
>
> out:
> debug_objects_fixups = oldfixups;
> @@ -1090,7 +1088,7 @@ void __init debug_objects_mem_init(void)
> debug_objects_enabled = 0;
> if (obj_cache)
> kmem_cache_destroy(obj_cache);
> - printk(KERN_WARNING "ODEBUG: out of memory.\n");
> + pr_warn("ODEBUG: out of memory.\n");
> } else
> debug_objects_selftest();
> }
> --
> 1.8.4.5
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/4] lib/debugobjects.c: convert printk to pr_foo()
2014-05-24 21:53 ` Josh Triplett
@ 2014-05-25 3:18 ` Fabian Frederick
2014-05-25 3:40 ` Josh Triplett
0 siblings, 1 reply; 6+ messages in thread
From: Fabian Frederick @ 2014-05-25 3:18 UTC (permalink / raw)
To: Josh Triplett; +Cc: linux-kernel, Andrew Morton
On Sat, 24 May 2014 14:53:22 -0700
Josh Triplett <josh@joshtriplett.org> wrote:
> On Sat, May 24, 2014 at 03:06:08PM +0200, Fabian Frederick wrote:
> > Convert all except KERN_DEBUG
>
> Why not KERN_DEBUG?
printk(KERN_DEBUG can't be converted to pr_debug the same way as other printk.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] lib/debugobjects.c: convert printk to pr_foo()
2014-05-25 3:18 ` Fabian Frederick
@ 2014-05-25 3:40 ` Josh Triplett
2014-05-27 14:25 ` Fabian Frederick
0 siblings, 1 reply; 6+ messages in thread
From: Josh Triplett @ 2014-05-25 3:40 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Andrew Morton
On Sun, May 25, 2014 at 05:18:36AM +0200, Fabian Frederick wrote:
> On Sat, 24 May 2014 14:53:22 -0700
> Josh Triplett <josh@joshtriplett.org> wrote:
>
> > On Sat, May 24, 2014 at 03:06:08PM +0200, Fabian Frederick wrote:
> > > Convert all except KERN_DEBUG
> >
> > Why not KERN_DEBUG?
> printk(KERN_DEBUG can't be converted to pr_debug the same way as other printk.
True, but I don't see any obvious reason why that prevents you from
converting them. More importantly, though, you should explain for the
benefit of the changelog.
- Josh Triplett
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] lib/debugobjects.c: convert printk to pr_foo()
2014-05-25 3:40 ` Josh Triplett
@ 2014-05-27 14:25 ` Fabian Frederick
2014-05-28 4:10 ` Josh Triplett
0 siblings, 1 reply; 6+ messages in thread
From: Fabian Frederick @ 2014-05-27 14:25 UTC (permalink / raw)
To: Josh Triplett; +Cc: linux-kernel, Andrew Morton
On Sat, 24 May 2014 20:40:43 -0700
Josh Triplett <josh@joshtriplett.org> wrote:
> On Sun, May 25, 2014 at 05:18:36AM +0200, Fabian Frederick wrote:
> > On Sat, 24 May 2014 14:53:22 -0700
> > Josh Triplett <josh@joshtriplett.org> wrote:
> >
> > > On Sat, May 24, 2014 at 03:06:08PM +0200, Fabian Frederick wrote:
> > > > Convert all except KERN_DEBUG
> > >
> > > Why not KERN_DEBUG?
> > printk(KERN_DEBUG can't be converted to pr_debug the same way as other printk.
>
> True, but I don't see any obvious reason why that prevents you from
> converting them. More importantly, though, you should explain for the
> benefit of the changelog.
There's no documentation yet in mainline for this but in linux-next:
commit 8ce2658fc31bb7
I can submit one more patch with pr_debug conversion using #define DEBUG
or compilation -DDEBUG
Fabian
>
> - Josh Triplett
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] lib/debugobjects.c: convert printk to pr_foo()
2014-05-27 14:25 ` Fabian Frederick
@ 2014-05-28 4:10 ` Josh Triplett
0 siblings, 0 replies; 6+ messages in thread
From: Josh Triplett @ 2014-05-28 4:10 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Andrew Morton
On Tue, May 27, 2014 at 04:25:54PM +0200, Fabian Frederick wrote:
> On Sat, 24 May 2014 20:40:43 -0700
> Josh Triplett <josh@joshtriplett.org> wrote:
>
> > On Sun, May 25, 2014 at 05:18:36AM +0200, Fabian Frederick wrote:
> > > On Sat, 24 May 2014 14:53:22 -0700
> > > Josh Triplett <josh@joshtriplett.org> wrote:
> > >
> > > > On Sat, May 24, 2014 at 03:06:08PM +0200, Fabian Frederick wrote:
> > > > > Convert all except KERN_DEBUG
> > > >
> > > > Why not KERN_DEBUG?
> > > printk(KERN_DEBUG can't be converted to pr_debug the same way as other printk.
> >
> > True, but I don't see any obvious reason why that prevents you from
> > converting them. More importantly, though, you should explain for the
> > benefit of the changelog.
>
> There's no documentation yet in mainline for this but in linux-next:
> commit 8ce2658fc31bb7
>
> I can submit one more patch with pr_debug conversion using #define DEBUG
> or compilation -DDEBUG
Definitely keep it as a separate patch, but I don't think you should
define DEBUG by default; just let people turn it on if desired, and
leave it out otherwise. There's only a single KERN_DEBUG printk in this
driver, and it seems fine to just convert to pr_debug so it gets left
out of normal builds.
- Josh Triplett
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-05-28 4:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-24 13:06 [PATCH 1/4] lib/debugobjects.c: convert printk to pr_foo() Fabian Frederick
2014-05-24 21:53 ` Josh Triplett
2014-05-25 3:18 ` Fabian Frederick
2014-05-25 3:40 ` Josh Triplett
2014-05-27 14:25 ` Fabian Frederick
2014-05-28 4:10 ` Josh Triplett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).