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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1300C4332F for ; Fri, 30 Dec 2022 21:15:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235573AbiL3VPa (ORCPT ); Fri, 30 Dec 2022 16:15:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235422AbiL3VP2 (ORCPT ); Fri, 30 Dec 2022 16:15:28 -0500 Received: from mx17lb.world4you.com (mx17lb.world4you.com [81.19.149.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B38331C913 for ; Fri, 30 Dec 2022 13:15:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=engleder-embedded.com; s=dkim11; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wgQFiKRrPj0iVoG9wI+hMA5E5xdb5lHyTH4epgK/EZE=; b=EY103WKFSlpGqOK67En9Qv5HV2 32ZAa7LePealUVcdmrFhQQ7ynjbH/cYFaH5AtoTbW+GvgOltjDqw/5DOUTNDpYPgHIpcqm76Bybvm /TOpzjclEdmwe7Yb8T2BzljtElpi9TjzZgic33+0m61mZ+bRkCJrIzpMNuHZK+zD6zQY=; Received: from [88.117.53.17] (helo=[10.0.0.160]) by mx17lb.world4you.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pBMiq-0000PL-IS; Fri, 30 Dec 2022 22:15:24 +0100 Message-ID: Date: Fri, 30 Dec 2022 22:15:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] checkpatch: Ignore ETHTOOL_LINK_MODE_ enum values Content-Language: en-US To: Joe Perches , linux-kernel@vger.kernel.org Cc: apw@canonical.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com References: <20221230195907.3959-1-gerhard@engleder-embedded.com> From: Gerhard Engleder In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AV-Do-Run: Yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.12.22 21:31, Joe Perches wrote: > On Fri, 2022-12-30 at 20:59 +0100, Gerhard Engleder wrote: >> Since commit 4104a20646 enum values like >> ETHTOOL_LINK_MODE_Asym_Pause_BIT are ignored. But there are other enums >> like ETHTOOL_LINK_MODE_1000baseT_Full_BIT, which are not ignored >> because of the not matching '1000baseT' substring. >> >> Extend regex to match also substrings like '1000baseT'. > [] >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > [] >> @@ -5780,7 +5780,7 @@ sub process { >> if ($var !~ /^$Constant$/ && >> $var =~ /[A-Z][a-z]|[a-z][A-Z]/ && >> #Ignore some autogenerated defines and enum values >> - $var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ && >> + $var !~ /^(?:[A-Z]+_){1,5}([A-Z]{1,3}[a-z]|[0-9]+[a-z]+[A-Z])/ && > > NAK. > > This introduces an unnecessary capture group and as well it would also > allow too many other variants that should get a warning. A more exact link mode regex [0-9]+base[A-Z0-9]+_(Half|Full) would eliminate unwanted matches. Shall I extend the existing regex or would a separate regex with comment be the better choice? Gerhard