public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] char: Prefer pr_* instead of printk
@ 2016-06-04 14:45 Jyoti Singh
  2016-06-04 16:36 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Jyoti Singh @ 2016-06-04 14:45 UTC (permalink / raw)
  To: arnd; +Cc: gregkh, linux-kernel, Jyoti Singh

This patch replaces all the printk[KERN_INFO] with pr_* in the file
"ttyprintk.c" addressing the following warning:

WARNING:Prefer [subsystem eg: netdev]_info([subsystem]dev, ...
then dev_info(dev,... then pr_info(...  to printk(KERN_INFO ...
Found with checkpatch

Signed-off-by: Jyoti Singh <jssengar@gmail.com>
---
 drivers/char/ttyprintk.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
index b098d2d..ca14f3e 100644
--- a/drivers/char/ttyprintk.c
+++ b/drivers/char/ttyprintk.c
@@ -51,7 +51,7 @@ static int tpk_printk(const unsigned char *buf, int count)
 			/* non nl or cr terminated message - add nl */
 			tmp[tpk_curr + 0] = '\n';
 			tmp[tpk_curr + 1] = '\0';
-			printk(KERN_INFO "%s%s", tpk_tag, tmp);
+			pr_info("%s%s", tpk_tag, tmp);
 			tpk_curr = 0;
 		}
 		return i;
@@ -65,14 +65,14 @@ static int tpk_printk(const unsigned char *buf, int count)
 				/* replace cr with nl */
 				tmp[tpk_curr + 0] = '\n';
 				tmp[tpk_curr + 1] = '\0';
-				printk(KERN_INFO "%s%s", tpk_tag, tmp);
+				pr_info("%s%s", tpk_tag, tmp);
 				tpk_curr = 0;
 				if ((i + 1) < count && buf[i + 1] == '\n')
 					i++;
 				break;
 			case '\n':
 				tmp[tpk_curr + 1] = '\0';
-				printk(KERN_INFO "%s%s", tpk_tag, tmp);
+				pr_info("%s%s", tpk_tag, tmp);
 				tpk_curr = 0;
 				break;
 			default:
@@ -83,7 +83,7 @@ static int tpk_printk(const unsigned char *buf, int count)
 			tmp[tpk_curr + 1] = '\\';
 			tmp[tpk_curr + 2] = '\n';
 			tmp[tpk_curr + 3] = '\0';
-			printk(KERN_INFO "%s%s", tpk_tag, tmp);
+			pr_info("%s%s", tpk_tag, tmp);
 			tpk_curr = 0;
 		}
 	}
@@ -203,7 +203,7 @@ static int __init ttyprintk_init(void)
 
 	ret = tty_register_driver(ttyprintk_driver);
 	if (ret < 0) {
-		printk(KERN_ERR "Couldn't register ttyprintk driver\n");
+		pr_err("Couldn't register ttyprintk driver\n");
 		goto error;
 	}
 
-- 
1.9.3

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

end of thread, other threads:[~2016-06-06 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-04 14:45 [PATCH] char: Prefer pr_* instead of printk Jyoti Singh
2016-06-04 16:36 ` Greg KH
     [not found]   ` <CADAjwjQq5u2LYeOQa-L5BJ40hTYcp-23PiBLLHABznVhvkHRUg@mail.gmail.com>
     [not found]     ` <20160605150322.GB14267@kroah.com>
     [not found]       ` <CADAjwjSiztcEVMrZEAj34QJK+sn6E8P98edE8Y7=udXYfYWv_g@mail.gmail.com>
2016-06-06  6:14         ` jyoti singh
2016-06-06 14:30           ` Greg KH
2016-06-06 15:23   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox