From patchwork Wed Apr 19 21:42:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 752549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w7b8T11FQz9s4s for ; Thu, 20 Apr 2017 07:43:05 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BDD45C26; Wed, 19 Apr 2017 21:43:02 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 1C089BA3 for ; Wed, 19 Apr 2017 21:43:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id BEB8415B for ; Wed, 19 Apr 2017 21:43:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B87264361 for ; Wed, 19 Apr 2017 21:43:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2B87264361 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=aconole@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2B87264361 Received: from dhcp-25-97.bos.redhat.com (ovpn-122-151.rdu2.redhat.com [10.10.122.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36A3277DCC; Wed, 19 Apr 2017 21:43:00 +0000 (UTC) From: Aaron Conole To: dev@openvswitch.org Date: Wed, 19 Apr 2017 17:42:58 -0400 Message-Id: <20170419214258.17470-1-aconole@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 19 Apr 2017 21:43:01 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] checkpatch: fix pointer declaration X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Lance pointed to a problem where scripts were incorrectly being flagged as pointer spacing warnings. As an example, the text: --u*|-u) would flag the warning. Since the type name should always have a space in front of it, change the regex to require some spacing. Additionally, ** is a common notation in comments to mean 'raise to the power of', so ensure that it is not accidentally flagged as well by adding a not-group populated with *. Reported-by: Lance Richardson Signed-off-by: Aaron Conole --- utilities/checkpatch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index 638ac97..31cbce2 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -68,7 +68,8 @@ __regex_is_for_if_single_line_bracket = \ re.compile(r'^ +(if|for|while) \(.*\)') __regex_ends_with_bracket = \ re.compile(r'[^\s]\) {(\s+/\*[\s\Sa-zA-Z0-9\.,\?\*/+-]*)?$') -__regex_ptr_declaration_missing_whitespace = re.compile(r'[a-zA-Z0-9]\*') +__regex_ptr_declaration_missing_whitespace = \ + re.compile(r'\s[a-zA-Z0-9_]+\*[^*]') skip_leading_whitespace_check = False skip_trailing_whitespace_check = False