From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753959AbcBPFzY (ORCPT ); Tue, 16 Feb 2016 00:55:24 -0500 Received: from smtprelay0080.hostedemail.com ([216.40.44.80]:48245 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752232AbcBPFzU (ORCPT ); Tue, 16 Feb 2016 00:55:20 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3871:4321:5007:6261:7576:9207:10004:10226:10400:10848:11026:11232:11657:11658:11783:11914:12043:12048:12296:12438:12517:12519:12740:13069:13311:13357:13894:14659:21080:30054:30060:30064:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: cats13_11459affb012f X-Filterd-Recvd-Size: 2582 Message-ID: <1455602117.4046.45.camel@perches.com> Subject: Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_ From: Joe Perches To: green@linuxhacker.ru, Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger Cc: Linux Kernel Mailing List , Lustre Development List Date: Mon, 15 Feb 2016 21:55:17 -0800 In-Reply-To: <1455601637-3847710-44-git-send-email-green@linuxhacker.ru> References: <1455601637-3847710-1-git-send-email-green@linuxhacker.ru> <1455601637-3847710-44-git-send-email-green@linuxhacker.ru> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.4-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-02-16 at 00:47 -0500, green@linuxhacker.ru wrote: > From: Oleg Drokin > > This pacifies checkpatch amongst other things, also is shorter to write > and avoiding calls to printk_ratelimit() is also good. [] > diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c [] > @@ -244,11 +244,11 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask, >   } >   >   if ((mask & D_CONSOLE) != 0) { > - printk("%s%s: %.*s", ptype, prefix, len, buf); > + pr_err("%s%s: %.*s", ptype, prefix, len, buf); >   } else { > - printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix, > -        hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num, > -        fn, len, buf); > + pr_warn("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix, > + hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num, > + fn, len, buf); >   } >  } This breaks the currently correct output. ptype is already a KERN_ char *prefix = "Lustre", *ptype = NULL; if ((mask & D_EMERG) != 0) { prefix = dbghdr_to_err_string(hdr); ptype = KERN_EMERG; } else if ((mask & D_ERROR) != 0) { prefix = dbghdr_to_err_string(hdr); ptype = KERN_ERR; } else if ((mask & D_WARNING) != 0) { prefix = dbghdr_to_info_string(hdr); ptype = KERN_WARNING; } else if ((mask & (D_CONSOLE | libcfs_printk)) != 0) { prefix = dbghdr_to_info_string(hdr); ptype = KERN_INFO; }