From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68A70C433E0 for ; Wed, 30 Dec 2020 18:53:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2692222242 for ; Wed, 30 Dec 2020 18:53:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbgL3SxH (ORCPT ); Wed, 30 Dec 2020 13:53:07 -0500 Received: from smtprelay0023.hostedemail.com ([216.40.44.23]:57208 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726230AbgL3SxG (ORCPT ); Wed, 30 Dec 2020 13:53:06 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 96352181D3039; Wed, 30 Dec 2020 18:52:25 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: paste15_3a0f762274a7 X-Filterd-Recvd-Size: 1781 Received: from [192.168.1.159] (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA; Wed, 30 Dec 2020 18:52:24 +0000 (UTC) Message-ID: <58de45f3a0c7a4517110523edeccf19e6cec538c.camel@perches.com> Subject: Re: [BUG] checkpatch: non-standard types cannot be declared after '}' From: Joe Perches To: Jan Schlien , Andy Whitcroft Cc: linux-kernel@vger.kernel.org Date: Wed, 30 Dec 2020 10:52:23 -0800 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-12-30 at 14:36 +0100, Jan Schlien wrote: > Hi, > > I found some odd behavior of checkpatch.pl, which I'm currently using > for own projects outside the kernel, but I verified that kernel patches > can be affected as well. Hello Jan. I've had this patch locally for awhile that I believe fixes this and another issue ($stat blocks can start with a close brace). I've been waiting for Andy to review it in case there's some other parsing problem associated with it. --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 00085308ed9d..012c8dc6cb1a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1555,7 +1555,7 @@ sub ctx_statement_block { # Statement ends at the ';' or a close '}' at the # outermost level. - if ($level == 0 && $c eq ';') { + if ($level == 0 && ($c eq ';' || $c eq '}')) { last; }