From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751049AbcFDOpf (ORCPT ); Sat, 4 Jun 2016 10:45:35 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36479 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750887AbcFDOpc (ORCPT ); Sat, 4 Jun 2016 10:45:32 -0400 From: Jyoti Singh To: arnd@arndb.de Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Jyoti Singh Subject: [PATCH] char: Prefer pr_* instead of printk Date: Sat, 4 Jun 2016 20:15:11 +0530 Message-Id: <1465051511-10758-1-git-send-email-jssengar92@gmail.com> X-Mailer: git-send-email 1.9.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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