Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757041AbZLER6A (ORCPT ); Sat, 5 Dec 2009 12:58:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756811AbZLER56 (ORCPT ); Sat, 5 Dec 2009 12:57:58 -0500 Received: from mail.perches.com ([173.55.12.10]:1032 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755628AbZLER56 (ORCPT ); Sat, 5 Dec 2009 12:57:58 -0500 Subject: [PATCH] scripts/checkpatch.pl: Add warning about leading contination tests From: Joe Perches To: Andy Whitcroft Cc: David Miller , LKML , William Allen Simpson Content-Type: text/plain; charset="UTF-8" Date: Sat, 05 Dec 2009 09:58:04 -0800 Message-ID: <1260035884.11126.58.camel@Joe-Laptop.home> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 890 Lines: 25 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.*/ && -- 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/