* [PATCH] dynamic_printk: add line feed to printk
@ 2008-12-10 7:33 Wu Fengguang
2008-12-10 10:18 ` Marcel Holtmann
0 siblings, 1 reply; 8+ messages in thread
From: Wu Fengguang @ 2008-12-10 7:33 UTC (permalink / raw)
To: LKML; +Cc: Jason Baron, Greg Kroah-Hartman
Append '\n' to two printk messages.
Also cleanup the code to reduce one level of indentation.
Cc: Jason Baron <jbaron@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
lib/dynamic_printk.c | 58 ++++++++++++++++++-----------------------
1 file changed, 26 insertions(+), 32 deletions(-)
--- linux-2.6.orig/lib/dynamic_printk.c
+++ linux-2.6/lib/dynamic_printk.c
@@ -277,40 +277,34 @@ static ssize_t pr_debug_write(struct fil
dynamic_enabled = DYNAMIC_ENABLED_NONE;
}
err = 0;
- } else {
- if (elem) {
- if (value && (elem->enable == 0)) {
- dynamic_printk_enabled |=
- (1LL << elem->hash1);
- dynamic_printk_enabled2 |=
- (1LL << elem->hash2);
- elem->enable = 1;
- num_enabled++;
- dynamic_enabled = DYNAMIC_ENABLED_SOME;
- err = 0;
- printk(KERN_DEBUG
- "debugging enabled for module %s",
- elem->name);
- } else if (!value && (elem->enable == 1)) {
- elem->enable = 0;
- num_enabled--;
- if (disabled_hash(elem->hash1, true))
- dynamic_printk_enabled &=
+ } else if (elem) {
+ if (value && (elem->enable == 0)) {
+ dynamic_printk_enabled |= (1LL << elem->hash1);
+ dynamic_printk_enabled2 |= (1LL << elem->hash2);
+ elem->enable = 1;
+ num_enabled++;
+ dynamic_enabled = DYNAMIC_ENABLED_SOME;
+ err = 0;
+ printk(KERN_DEBUG
+ "debugging enabled for module %s\n",
+ elem->name);
+ } else if (!value && (elem->enable == 1)) {
+ elem->enable = 0;
+ num_enabled--;
+ if (disabled_hash(elem->hash1, true))
+ dynamic_printk_enabled &=
~(1LL << elem->hash1);
- if (disabled_hash(elem->hash2, false))
- dynamic_printk_enabled2 &=
+ if (disabled_hash(elem->hash2, false))
+ dynamic_printk_enabled2 &=
~(1LL << elem->hash2);
- if (num_enabled)
- dynamic_enabled =
- DYNAMIC_ENABLED_SOME;
- else
- dynamic_enabled =
- DYNAMIC_ENABLED_NONE;
- err = 0;
- printk(KERN_DEBUG
- "debugging disabled for module "
- "%s", elem->name);
- }
+ if (num_enabled)
+ dynamic_enabled = DYNAMIC_ENABLED_SOME;
+ else
+ dynamic_enabled = DYNAMIC_ENABLED_NONE;
+ err = 0;
+ printk(KERN_DEBUG
+ "debugging disabled for module %s\n",
+ elem->name);
}
}
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dynamic_printk: add line feed to printk
2008-12-10 7:33 [PATCH] dynamic_printk: add line feed to printk Wu Fengguang
@ 2008-12-10 10:18 ` Marcel Holtmann
2008-12-10 14:40 ` Wu Fengguang
0 siblings, 1 reply; 8+ messages in thread
From: Marcel Holtmann @ 2008-12-10 10:18 UTC (permalink / raw)
To: Wu Fengguang; +Cc: LKML, Jason Baron, Greg Kroah-Hartman
Hi,
> Append '\n' to two printk messages.
I already sent a patch for that and Greg picked it up.
> Also cleanup the code to reduce one level of indentation.
Please re-base that one against Greg's latest tree that includes my
patch.
Regards
Marcel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dynamic_printk: add line feed to printk
2008-12-10 10:18 ` Marcel Holtmann
@ 2008-12-10 14:40 ` Wu Fengguang
2008-12-10 15:01 ` Marcel Holtmann
2008-12-10 15:23 ` Greg KH
0 siblings, 2 replies; 8+ messages in thread
From: Wu Fengguang @ 2008-12-10 14:40 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: LKML, Jason Baron, Greg Kroah-Hartman
On Wed, Dec 10, 2008 at 12:18:46PM +0200, Marcel Holtmann wrote:
> Hi,
>
> > Append '\n' to two printk messages.
>
> I already sent a patch for that and Greg picked it up.
No I didn't find it in the usb-2.6 tree:
git pull git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6.git
>From git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* branch HEAD -> FETCH_HEAD
Already up-to-date.
> > Also cleanup the code to reduce one level of indentation.
>
> Please re-base that one against Greg's latest tree that includes my
> patch.
Sorry, it's me :)
Thanks,
Fengguang
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dynamic_printk: add line feed to printk
2008-12-10 14:40 ` Wu Fengguang
@ 2008-12-10 15:01 ` Marcel Holtmann
2008-12-10 15:23 ` Greg KH
1 sibling, 0 replies; 8+ messages in thread
From: Marcel Holtmann @ 2008-12-10 15:01 UTC (permalink / raw)
To: Wu Fengguang; +Cc: LKML, Jason Baron, Greg Kroah-Hartman
Hi,
> > > Append '\n' to two printk messages.
> >
> > I already sent a patch for that and Greg picked it up.
>
> No I didn't find it in the usb-2.6 tree:
I don't know in detail how Greg manages its trees, but here is the patch
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver-core.current/driver-core-add-newlines-to-debugging-enabled-disabled-messages.patch
Regards
Marcel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dynamic_printk: add line feed to printk
2008-12-10 14:40 ` Wu Fengguang
2008-12-10 15:01 ` Marcel Holtmann
@ 2008-12-10 15:23 ` Greg KH
2008-12-10 23:43 ` Wu Fengguang
1 sibling, 1 reply; 8+ messages in thread
From: Greg KH @ 2008-12-10 15:23 UTC (permalink / raw)
To: Wu Fengguang; +Cc: Marcel Holtmann, LKML, Jason Baron
On Wed, Dec 10, 2008 at 10:40:58PM +0800, Wu Fengguang wrote:
> On Wed, Dec 10, 2008 at 12:18:46PM +0200, Marcel Holtmann wrote:
> > Hi,
> >
> > > Append '\n' to two printk messages.
> >
> > I already sent a patch for that and Greg picked it up.
>
> No I didn't find it in the usb-2.6 tree:
>
> git pull git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6.git
> >From git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
> * branch HEAD -> FETCH_HEAD
> Already up-to-date.
That's not the "usb" tree, if you read the description, it should be
clear.
My tree is in quilt, please see the MAINTAINERS file for details.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dynamic_printk: add line feed to printk
2008-12-10 15:23 ` Greg KH
@ 2008-12-10 23:43 ` Wu Fengguang
2008-12-11 15:25 ` Jason Baron
2008-12-12 19:08 ` Greg KH
0 siblings, 2 replies; 8+ messages in thread
From: Wu Fengguang @ 2008-12-10 23:43 UTC (permalink / raw)
To: Greg KH; +Cc: Marcel Holtmann, LKML, Jason Baron
On Wed, Dec 10, 2008 at 05:23:23PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Dec 10, 2008 at 10:40:58PM +0800, Wu Fengguang wrote:
> > On Wed, Dec 10, 2008 at 12:18:46PM +0200, Marcel Holtmann wrote:
> > > Hi,
> > >
> > > > Append '\n' to two printk messages.
> > >
> > > I already sent a patch for that and Greg picked it up.
> >
> > No I didn't find it in the usb-2.6 tree:
> >
> > git pull git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6.git
> > >From git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
> > * branch HEAD -> FETCH_HEAD
> > Already up-to-date.
>
> That's not the "usb" tree, if you read the description, it should be
> clear.
Yup, it reads "junk tree, please ignore". When I first found it in
git.kernel.org, I chose to trust the name 'usb-2.6' instead of its
description...
> My tree is in quilt, please see the MAINTAINERS file for details.
Got it. Below is the updated patch based on Marcel's one.
Thanks,
Fengguang
---
dynamic_printk: reduce one level of indentation
Cleanup pr_debug_write() to reduce one level of indentation.
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
lib/dynamic_printk.c | 58 ++++++++++++++++++-----------------------
1 file changed, 26 insertions(+), 32 deletions(-)
--- mm.orig/lib/dynamic_printk.c
+++ mm/lib/dynamic_printk.c
@@ -277,40 +277,34 @@ static ssize_t pr_debug_write(struct fil
dynamic_enabled = DYNAMIC_ENABLED_NONE;
}
err = 0;
- } else {
- if (elem) {
- if (value && (elem->enable == 0)) {
- dynamic_printk_enabled |=
- (1LL << elem->hash1);
- dynamic_printk_enabled2 |=
- (1LL << elem->hash2);
- elem->enable = 1;
- num_enabled++;
- dynamic_enabled = DYNAMIC_ENABLED_SOME;
- err = 0;
- printk(KERN_DEBUG
- "debugging enabled for module %s\n",
- elem->name);
- } else if (!value && (elem->enable == 1)) {
- elem->enable = 0;
- num_enabled--;
- if (disabled_hash(elem->hash1, true))
- dynamic_printk_enabled &=
+ } else if (elem) {
+ if (value && (elem->enable == 0)) {
+ dynamic_printk_enabled |= (1LL << elem->hash1);
+ dynamic_printk_enabled2 |= (1LL << elem->hash2);
+ elem->enable = 1;
+ num_enabled++;
+ dynamic_enabled = DYNAMIC_ENABLED_SOME;
+ err = 0;
+ printk(KERN_DEBUG
+ "debugging enabled for module %s\n",
+ elem->name);
+ } else if (!value && (elem->enable == 1)) {
+ elem->enable = 0;
+ num_enabled--;
+ if (disabled_hash(elem->hash1, true))
+ dynamic_printk_enabled &=
~(1LL << elem->hash1);
- if (disabled_hash(elem->hash2, false))
- dynamic_printk_enabled2 &=
+ if (disabled_hash(elem->hash2, false))
+ dynamic_printk_enabled2 &=
~(1LL << elem->hash2);
- if (num_enabled)
- dynamic_enabled =
- DYNAMIC_ENABLED_SOME;
- else
- dynamic_enabled =
- DYNAMIC_ENABLED_NONE;
- err = 0;
- printk(KERN_DEBUG
- "debugging disabled for module "
- "%s\n", elem->name);
- }
+ if (num_enabled)
+ dynamic_enabled = DYNAMIC_ENABLED_SOME;
+ else
+ dynamic_enabled = DYNAMIC_ENABLED_NONE;
+ err = 0;
+ printk(KERN_DEBUG
+ "debugging disabled for module %s\n",
+ elem->name);
}
}
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dynamic_printk: add line feed to printk
2008-12-10 23:43 ` Wu Fengguang
@ 2008-12-11 15:25 ` Jason Baron
2008-12-12 19:08 ` Greg KH
1 sibling, 0 replies; 8+ messages in thread
From: Jason Baron @ 2008-12-11 15:25 UTC (permalink / raw)
To: Wu Fengguang; +Cc: Greg KH, Marcel Holtmann, LKML
On Thu, Dec 11, 2008 at 07:43:17AM +0800, Wu Fengguang wrote:
> Got it. Below is the updated patch based on Marcel's one.
>
> Thanks,
> Fengguang
> ---
> dynamic_printk: reduce one level of indentation
>
> Cleanup pr_debug_write() to reduce one level of indentation.
>
> Cc: Marcel Holtmann <marcel@holtmann.org>
> Cc: Jason Baron <jbaron@redhat.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
thanks for the cleanup.
Acked-by: Jason Baron <jbaron@redhat.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dynamic_printk: add line feed to printk
2008-12-10 23:43 ` Wu Fengguang
2008-12-11 15:25 ` Jason Baron
@ 2008-12-12 19:08 ` Greg KH
1 sibling, 0 replies; 8+ messages in thread
From: Greg KH @ 2008-12-12 19:08 UTC (permalink / raw)
To: Wu Fengguang; +Cc: Greg KH, Marcel Holtmann, LKML, Jason Baron
On Thu, Dec 11, 2008 at 07:43:17AM +0800, Wu Fengguang wrote:
> On Wed, Dec 10, 2008 at 05:23:23PM +0200, Greg Kroah-Hartman wrote:
> > On Wed, Dec 10, 2008 at 10:40:58PM +0800, Wu Fengguang wrote:
> > > On Wed, Dec 10, 2008 at 12:18:46PM +0200, Marcel Holtmann wrote:
> > > > Hi,
> > > >
> > > > > Append '\n' to two printk messages.
> > > >
> > > > I already sent a patch for that and Greg picked it up.
> > >
> > > No I didn't find it in the usb-2.6 tree:
> > >
> > > git pull git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6.git
> > > >From git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
> > > * branch HEAD -> FETCH_HEAD
> > > Already up-to-date.
> >
> > That's not the "usb" tree, if you read the description, it should be
> > clear.
>
> Yup, it reads "junk tree, please ignore". When I first found it in
> git.kernel.org, I chose to trust the name 'usb-2.6' instead of its
> description...
Heh, as if I just added that description for the fun of it :)
> > My tree is in quilt, please see the MAINTAINERS file for details.
>
> Got it. Below is the updated patch based on Marcel's one.
Thanks, I'll queue it up.
grg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-12-12 19:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 7:33 [PATCH] dynamic_printk: add line feed to printk Wu Fengguang
2008-12-10 10:18 ` Marcel Holtmann
2008-12-10 14:40 ` Wu Fengguang
2008-12-10 15:01 ` Marcel Holtmann
2008-12-10 15:23 ` Greg KH
2008-12-10 23:43 ` Wu Fengguang
2008-12-11 15:25 ` Jason Baron
2008-12-12 19:08 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox