All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] panel: Remove printk(KERN_DEBUG ...) located in the #if 0 block
@ 2012-07-12 13:00 Toshiaki Yamane
  2012-07-12 13:01 ` [PATCH 2/3] panel: Use pr_info(...) rather than printk(KERN_INFO Toshiaki Yamane
  2012-07-12 13:01 ` [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...) Toshiaki Yamane
  0 siblings, 2 replies; 5+ messages in thread
From: Toshiaki Yamane @ 2012-07-12 13:00 UTC (permalink / raw)
  To: greg, willy; +Cc: linux-kernel, joe, rmallon, Toshiaki Yamane

Deleted #if 0 blocks

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/panel/panel.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 7365089..c625567 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1837,12 +1837,6 @@ static void panel_process_inputs(void)
 	struct list_head *item;
 	struct logical_input *input;
 
-#if 0
-	printk(KERN_DEBUG
-	       "entering panel_process_inputs with pp=%016Lx & pc=%016Lx\n",
-	       phys_prev, phys_curr);
-#endif
-
 	keypressed = 0;
 	inputs_stable = 1;
 	list_for_each(item, &logical_inputs) {
@@ -2002,10 +1996,6 @@ static struct logical_input *panel_bind_key(char *name, char *press,
 	key->rise_time = 1;
 	key->fall_time = 1;
 
-#if 0
-	printk(KERN_DEBUG "bind: <%s> : m=%016Lx v=%016Lx\n", name, key->mask,
-	       key->value);
-#endif
 	strncpy(key->u.kbd.press_str, press, sizeof(key->u.kbd.press_str));
 	strncpy(key->u.kbd.repeat_str, repeat, sizeof(key->u.kbd.repeat_str));
 	strncpy(key->u.kbd.release_str, release,
-- 
1.7.5.4


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

* [PATCH 2/3] panel: Use pr_info(...) rather than printk(KERN_INFO
  2012-07-12 13:00 [PATCH 1/3] panel: Remove printk(KERN_DEBUG ...) located in the #if 0 block Toshiaki Yamane
@ 2012-07-12 13:01 ` Toshiaki Yamane
  2012-07-12 13:01 ` [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...) Toshiaki Yamane
  1 sibling, 0 replies; 5+ messages in thread
From: Toshiaki Yamane @ 2012-07-12 13:01 UTC (permalink / raw)
  To: greg, willy; +Cc: linux-kernel, joe, rmallon, Toshiaki Yamane

-Added pr_fmt.
-Converted printk(KERN_INFO to pr_info
-Removed embedded message prefixes.

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/panel/panel.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index c625567..6f6d0c8 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -34,6 +34,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -2289,12 +2291,12 @@ int panel_init(void)
 	register_reboot_notifier(&panel_notifier);
 
 	if (pprt)
-		printk(KERN_INFO "Panel driver version " PANEL_VERSION
-		       " registered on parport%d (io=0x%lx).\n", parport,
-		       pprt->port->base);
+		pr_info("driver version " PANEL_VERSION
+			" registered on parport%d (io=0x%lx).\n", parport,
+			pprt->port->base);
 	else
-		printk(KERN_INFO "Panel driver version " PANEL_VERSION
-		       " not yet registered\n");
+		pr_info("driver version " PANEL_VERSION
+			" not yet registered\n");
 	/* tells various subsystems about the fact that initialization
 	   is finished */
 	init_in_progress = 0;
-- 
1.7.5.4


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

* [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...)
  2012-07-12 13:00 [PATCH 1/3] panel: Remove printk(KERN_DEBUG ...) located in the #if 0 block Toshiaki Yamane
  2012-07-12 13:01 ` [PATCH 2/3] panel: Use pr_info(...) rather than printk(KERN_INFO Toshiaki Yamane
@ 2012-07-12 13:01 ` Toshiaki Yamane
  1 sibling, 0 replies; 5+ messages in thread
From: Toshiaki Yamane @ 2012-07-12 13:01 UTC (permalink / raw)
  To: greg, willy; +Cc: linux-kernel, joe, rmallon, Toshiaki Yamane

-Removed unnecessary OOM messages.
-Removed embedded message prefixes.
-Added __func__ to some pr_err messages.
-Converted printk(KERN_ERR to pr_err
-Refactored split printk strings onto a single line
-Removed the space before the '!'.

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/panel/panel.c |   38 ++++++++++++++------------------------
 1 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 6f6d0c8..39f9982 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1983,10 +1983,9 @@ static struct logical_input *panel_bind_key(char *name, char *press,
 	struct logical_input *key;
 
 	key = kzalloc(sizeof(struct logical_input), GFP_KERNEL);
-	if (!key) {
-		printk(KERN_ERR "panel: not enough memory\n");
+	if (!key)
 		return NULL;
-	}
+
 	if (!input_name2mask(name, &key->mask, &key->value, &scan_mask_i,
 			     &scan_mask_o)) {
 		kfree(key);
@@ -2022,10 +2021,9 @@ static struct logical_input *panel_bind_callback(char *name,
 	struct logical_input *callback;
 
 	callback = kmalloc(sizeof(struct logical_input), GFP_KERNEL);
-	if (!callback) {
-		printk(KERN_ERR "panel: not enough memory\n");
+	if (!callback)
 		return NULL;
-	}
+
 	memset(callback, 0, sizeof(struct logical_input));
 	if (!input_name2mask(name, &callback->mask, &callback->value,
 			     &scan_mask_i, &scan_mask_o))
@@ -2102,10 +2100,8 @@ static void panel_attach(struct parport *port)
 		return;
 
 	if (pprt) {
-		printk(KERN_ERR
-		       "panel_attach(): port->number=%d parport=%d, "
-		       "already registered !\n",
-		       port->number, parport);
+		pr_err("%s: port->number=%d parport=%d, already registered!\n",
+		       __func__, port->number, parport);
 		return;
 	}
 
@@ -2114,16 +2110,14 @@ static void panel_attach(struct parport *port)
 				       /*PARPORT_DEV_EXCL */
 				       0, (void *)&pprt);
 	if (pprt == NULL) {
-		pr_err("panel_attach(): port->number=%d parport=%d, "
-		       "parport_register_device() failed\n",
-		       port->number, parport);
+		pr_err("%s: port->number=%d parport=%d, parport_register_device() failed\n",
+		       __func__, port->number, parport);
 		return;
 	}
 
 	if (parport_claim(pprt)) {
-		printk(KERN_ERR
-		       "Panel: could not claim access to parport%d. "
-		       "Aborting.\n", parport);
+		pr_err("could not claim access to parport%d. Aborting.\n",
+		       parport);
 		goto err_unreg_device;
 	}
 
@@ -2157,10 +2151,8 @@ static void panel_detach(struct parport *port)
 		return;
 
 	if (!pprt) {
-		printk(KERN_ERR
-		       "panel_detach(): port->number=%d parport=%d, "
-		       "nothing to unregister.\n",
-		       port->number, parport);
+		pr_err("%s: port->number=%d parport=%d, nothing to unregister.\n",
+		       __func__, port->number, parport);
 		return;
 	}
 
@@ -2270,8 +2262,7 @@ int panel_init(void)
 	init_in_progress = 1;
 
 	if (parport_register_driver(&panel_driver)) {
-		printk(KERN_ERR
-		       "Panel: could not register with parport. Aborting.\n");
+		pr_err("could not register with parport. Aborting.\n");
 		return -EIO;
 	}
 
@@ -2283,8 +2274,7 @@ int panel_init(void)
 			pprt = NULL;
 		}
 		parport_unregister_driver(&panel_driver);
-		printk(KERN_ERR "Panel driver version " PANEL_VERSION
-		       " disabled.\n");
+		pr_err("driver version " PANEL_VERSION " disabled.\n");
 		return -ENODEV;
 	}
 
-- 
1.7.5.4


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

* Re: [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...)
  2012-07-10 11:25 ` [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...) Toshiaki Yamane
@ 2012-07-10 20:59   ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2012-07-10 20:59 UTC (permalink / raw)
  To: Toshiaki Yamane; +Cc: greg, willy, linux-kernel

On Tue, 2012-07-10 at 20:25 +0900, Toshiaki Yamane wrote:
> This change is inspired by checkpatch.

[]

Please add
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
before any #include

and remove the "panel: " prefixes from output messages.

> diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
[]
> @@ -1987,7 +1987,7 @@ static struct logical_input *panel_bind_key(char *name, char *press,
>  
>  	key = kzalloc(sizeof(struct logical_input), GFP_KERNEL);
>  	if (!key) {
> -		printk(KERN_ERR "panel: not enough memory\n");
> +		pr_err("panel: not enough memory\n");

OOM messages are duplicative and unnecessary.
alloc failures get a dump_stack.

[]

> @@ -2109,8 +2109,7 @@ static void panel_attach(struct parport *port)
>  		return;
>  
>  	if (pprt) {
> -		printk(KERN_ERR
> -		       "panel_attach(): port->number=%d parport=%d, "
> +		pr_err("panel_attach(): port->number=%d parport=%d, "
>  		       "already registered !\n",

Please coalesce formats and use "%s: ...", __func__ when there
is an embedded function name.  It'd also be nice to use argument
alignment to open parenthesis.

		pr_err("%s: port->number=%d parport=%d, already registered\n",
		       port->number, parport);


etc...

cheers, Joe


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

* [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...)
  2012-07-10 11:22 [PATCH 1/3] panel: Use pr_debug(...) rather than printk(KERN_DEBUG ...) Toshiaki Yamane
@ 2012-07-10 11:25 ` Toshiaki Yamane
  2012-07-10 20:59   ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Toshiaki Yamane @ 2012-07-10 11:25 UTC (permalink / raw)
  To: greg, willy; +Cc: linux-kernel, Toshiaki Yamane

This change is inspired by checkpatch.

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/panel/panel.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 7b79f53..d6a7a51 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1987,7 +1987,7 @@ static struct logical_input *panel_bind_key(char *name, char *press,
 
 	key = kzalloc(sizeof(struct logical_input), GFP_KERNEL);
 	if (!key) {
-		printk(KERN_ERR "panel: not enough memory\n");
+		pr_err("panel: not enough memory\n");
 		return NULL;
 	}
 	if (!input_name2mask(name, &key->mask, &key->value, &scan_mask_i,
@@ -2030,7 +2030,7 @@ static struct logical_input *panel_bind_callback(char *name,
 
 	callback = kmalloc(sizeof(struct logical_input), GFP_KERNEL);
 	if (!callback) {
-		printk(KERN_ERR "panel: not enough memory\n");
+		pr_err("panel: not enough memory\n");
 		return NULL;
 	}
 	memset(callback, 0, sizeof(struct logical_input));
@@ -2109,8 +2109,7 @@ static void panel_attach(struct parport *port)
 		return;
 
 	if (pprt) {
-		printk(KERN_ERR
-		       "panel_attach(): port->number=%d parport=%d, "
+		pr_err("panel_attach(): port->number=%d parport=%d, "
 		       "already registered !\n",
 		       port->number, parport);
 		return;
@@ -2128,8 +2127,7 @@ static void panel_attach(struct parport *port)
 	}
 
 	if (parport_claim(pprt)) {
-		printk(KERN_ERR
-		       "Panel: could not claim access to parport%d. "
+		pr_err("Panel: could not claim access to parport%d. "
 		       "Aborting.\n", parport);
 		goto err_unreg_device;
 	}
@@ -2164,8 +2162,7 @@ static void panel_detach(struct parport *port)
 		return;
 
 	if (!pprt) {
-		printk(KERN_ERR
-		       "panel_detach(): port->number=%d parport=%d, "
+		pr_err("panel_detach(): port->number=%d parport=%d, "
 		       "nothing to unregister.\n",
 		       port->number, parport);
 		return;
@@ -2277,8 +2274,7 @@ int panel_init(void)
 	init_in_progress = 1;
 
 	if (parport_register_driver(&panel_driver)) {
-		printk(KERN_ERR
-		       "Panel: could not register with parport. Aborting.\n");
+		pr_err("Panel: could not register with parport. Aborting.\n");
 		return -EIO;
 	}
 
@@ -2290,7 +2286,7 @@ int panel_init(void)
 			pprt = NULL;
 		}
 		parport_unregister_driver(&panel_driver);
-		printk(KERN_ERR "Panel driver version " PANEL_VERSION
+		pr_err("Panel driver version " PANEL_VERSION
 		       " disabled.\n");
 		return -ENODEV;
 	}
-- 
1.7.5.4


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

end of thread, other threads:[~2012-07-12 13:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12 13:00 [PATCH 1/3] panel: Remove printk(KERN_DEBUG ...) located in the #if 0 block Toshiaki Yamane
2012-07-12 13:01 ` [PATCH 2/3] panel: Use pr_info(...) rather than printk(KERN_INFO Toshiaki Yamane
2012-07-12 13:01 ` [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...) Toshiaki Yamane
  -- strict thread matches above, loose matches on Subject: below --
2012-07-10 11:22 [PATCH 1/3] panel: Use pr_debug(...) rather than printk(KERN_DEBUG ...) Toshiaki Yamane
2012-07-10 11:25 ` [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...) Toshiaki Yamane
2012-07-10 20:59   ` Joe Perches

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.