From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942416AbcJ0Q5v (ORCPT ); Thu, 27 Oct 2016 12:57:51 -0400 Received: from smtprelay0237.hostedemail.com ([216.40.44.237]:46701 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934935AbcJ0Q5u (ORCPT ); Thu, 27 Oct 2016 12:57:50 -0400 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:2693:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:7903:10004:10400:10848:11026:11232:11658:11914:12296:12438:12555:12740:12760:13069:13095:13311:13357:13439:14181:14659:14721:21080:21212:21433:21451:30012:30054:30064:30070: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:1,LUA_SUMMARY:none X-HE-Tag: vein82_43ea8cfba3863 X-Filterd-Recvd-Size: 2451 Message-ID: <1477587465.30917.5.camel@perches.com> Subject: Re: [PATCH 2/4] printk/kdb: Handle more message headers From: Joe Perches To: Petr Mladek , Linus Torvalds Cc: Andrew Morton , Sergey Senozhatsky , Steven Rostedt , Jason Wessel , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , linux-kernel@vger.kernel.org Date: Thu, 27 Oct 2016 09:57:45 -0700 In-Reply-To: <1477583574-30988-3-git-send-email-pmladek@suse.com> References: <1477583574-30988-1-git-send-email-pmladek@suse.com> <1477583574-30988-3-git-send-email-pmladek@suse.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-10-27 at 17:52 +0200, Petr Mladek wrote: > The commit 4bcc595ccd80decb4245096e ("printk: reinstate KERN_CONT for > printing continuation lines") allows to define more message headers > for a single message. The motivation is that continuous lines might > get mixed. Therefore it make sense to define the right log level > for every piece of a cont line. > > This patch introduces printk_skip_headers() that will skip all > headers and uses it in the kdb code instead of printk_skip_level(). > > This approach helps to fix other printk_skip_level() users > independently. > > Signed-off-by: Petr Mladek > --- > include/linux/printk.h | 8 ++++++++ > kernel/debug/kdb/kdb_io.c | 2 +- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/include/linux/printk.h b/include/linux/printk.h [] > @@ -31,6 +31,14 @@ static inline const char *printk_skip_level(const char *buffer) > return buffer; > } > > +static inline const char *printk_skip_headers(const char *buffer) > +{ > + while (printk_get_level(buffer)) > + buffer += 2; At some point a level might be more than 1 char and it would be good to keep that check in just one place so using printk_skip_level would be more consistent.