Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756257AbZLFMNW (ORCPT ); Sun, 6 Dec 2009 07:13:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754556AbZLFMNV (ORCPT ); Sun, 6 Dec 2009 07:13:21 -0500 Received: from bamako.nerim.net ([62.4.17.28]:52141 "EHLO bamako.nerim.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753638AbZLFMNU convert rfc822-to-8bit (ORCPT ); Sun, 6 Dec 2009 07:13:20 -0500 Date: Sun, 6 Dec 2009 13:13:24 +0100 From: Jean Delvare To: Eric Dumazet Cc: Joe Perches , Andy Whitcroft , David Miller , LKML , William Allen Simpson Subject: Re: [PATCH] scripts/checkpatch.pl: Add warning about leading contination tests Message-ID: <20091206131324.55436006@hyperion.delvare> In-Reply-To: <4B1B6CB8.7000107@gmail.com> References: <1260035884.11126.58.camel@Joe-Laptop.home> <4B1B6CB8.7000107@gmail.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i586-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1445 Lines: 38 On Sun, 06 Dec 2009 09:35:04 +0100, Eric Dumazet wrote: > Joe Perches a écrit : > > Signed-off-by: Joe Perches > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > index bc4114f..c35933a 100755 > > --- a/scripts/checkpatch.pl > > +++ b/scripts/checkpatch.pl > > @@ -2064,6 +2064,11 @@ sub process { > > CHK("multiple assignments should be avoided\n" . $herecurr); > > } > > > > +# Check use of leading logical continuation tests > > + if ($line =~ /^.\s*(\|\||&&)/) { > > + WARN("Continuation logic should be at end of previous line\n" . $herecurr); > > + } > > + > > ## # check for multiple declarations, allowing for a function declaration > > ## # continuation. > > ## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ && > > > > > > Fine with me, but please add relevant info in Documentation/CodingStyle ? Not fine with me. Placing the binary logic operator at the beginning of a line can be a deliberate choice, either to make complex binary expressions more readable, or to avoid long lines. I don't see much point in banning this style, which BTW is used over 8000 times in the current kernel tree. -- Jean Delvare -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/