From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752052AbdKZGBb (ORCPT ); Sun, 26 Nov 2017 01:01:31 -0500 Received: from smtprelay0220.hostedemail.com ([216.40.44.220]:39973 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751126AbdKZGB3 (ORCPT ); Sun, 26 Nov 2017 01:01:29 -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:2553:2559:2562:2692:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4041:4321:5007:7903:8660:10004:10400:10848:11232:11658:11914:12043:12262:12296:12438:12555:12679:12740:12760:12895:13069:13095:13148:13161:13229:13230:13255:13311:13357:13439:14096:14097:14181:14659:14721:14819:21080:21212:21365:21433:21451:21627:30012:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: brain04_cba4e9147725 X-Filterd-Recvd-Size: 2451 Message-ID: <1511676085.20482.18.camel@perches.com> Subject: Re: [PATCH v2] checkpatch: Add a warning for log messages that don't end in a new line From: Joe Perches To: Julia Lawall , Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Whitcroft Date: Sat, 25 Nov 2017 22:01:25 -0800 In-Reply-To: References: <20171126054037.9743-1-logang@deltatee.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 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 Sun, 2017-11-26 at 06:51 +0100, Julia Lawall wrote: > > On Sat, 25 Nov 2017, Logan Gunthorpe wrote: > > > Check for lines with a log function using a relatively strict regular > > expression catching only printk, dev_* and pr_* functions. Once > > one is found, accumulate further lines for any functions that > > are split over multiple lines. > > I don't understand at all the second sentence. Are you staying with the > same call, or moving on to other calls? Also, it would be the call that > is split over multiple lines, not the function split over multiple lines. > > I think this would have been much easier with Cocccinelle where the code > is parsed and the control-flow graph is available to see whether there is > a pr_cont afterwards. But if it works, then it is surely good enough. It doesn't really work. Many of the messages aren't missing newlines. I only looked a the first few dozen instances, but many of them aren't really missing newlines, but are now missing a KERN_CONT annotation. This is because Linus changed how printk worked awhile ago in commit 4bcc595ccd80decb4245096e3d1258989c50ed41 Author: Linus Torvalds Date: Sat Oct 8 20:32:40 2016 -0700 printk: reinstate KERN_CONT for printing continuation lines Most of that commit message is BS, but the net effect is that now printks must have a KERN_ marker or a newline is inserted before the format. Also, this patch logic will be very confused by patch blocks and not files.