Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754074AbZJPSkK (ORCPT ); Fri, 16 Oct 2009 14:40:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754092AbZJPSkG (ORCPT ); Fri, 16 Oct 2009 14:40:06 -0400 Received: from adelie.canonical.com ([91.189.90.139]:53065 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754074AbZJPSkC (ORCPT ); Fri, 16 Oct 2009 14:40:02 -0400 From: Andy Whitcroft To: Andrew Morton Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Andy Whitcroft Subject: [PATCH 4/7] checkpatch: fix false errors due to macro concatenation Date: Fri, 16 Oct 2009 19:39:29 +0100 Message-Id: <1255718372-22805-5-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1255718372-22805-1-git-send-email-apw@canonical.com> References: <1255718372-22805-1-git-send-email-apw@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1540 Lines: 49 The macro concatenation (##) sequence can cause false errors when checking macro's. Checkpatch doesn't currently know about the operator. For example this line, + entry = (struct ftrace_raw_##call *)raw_data; \ is correct but it produces the following error, ERROR: need consistent spacing around '*' (ctx:WxB) + entry = (struct ftrace_raw_##call *)raw_data;\ ^ The line above doesn't have any spacing problems, and if you remove the macro concatenation sequence checkpatch doesn't give any errors. Extend identifier handling to include ## concatenation within the definition of an identifier. Reported-by: Daniel Walker Signed-off-by: Andy Whitcroft --- scripts/checkpatch.pl | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 05b10d6..cb2dac3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -130,7 +130,10 @@ if ($tree) { my $emitted_corrupt = 0; -our $Ident = qr{[A-Za-z_][A-Za-z\d_]*}; +our $Ident = qr{ + [A-Za-z_][A-Za-z\d_]* + (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)* + }x; our $Storage = qr{extern|static|asmlinkage}; our $Sparse = qr{ __user| -- 1.6.3.3 -- 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/