Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7834463rwl; Fri, 30 Dec 2022 16:01:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXvnEtBS6RlWanMC2Kkwo/Gnr1KMFBUgP72T9X1l9hxBlq/ilQQW7ttsMKv/8CHLEkH6Ug0y X-Received: by 2002:a17:902:d585:b0:189:62f7:e5fc with SMTP id k5-20020a170902d58500b0018962f7e5fcmr38893219plh.14.1672444908474; Fri, 30 Dec 2022 16:01:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672444908; cv=none; d=google.com; s=arc-20160816; b=yS1lbCDzvnPA9otFu81HraU9UouBMooDhZLvEBgI4N9uf2UAoLE7QRGcVgk5TmvKDG BrrV6uxxBnN/CUr2ABj+IUTnDLRUEQEgur8EN4lMLbHQtrVje1tRjEGX/tViOQESFwRz kTzNx3H1pHzyaJ8nYP67rKIPmwZIxqXDDl8qt+jrLvEMI8FROT44ItjFgzq4R6q/IJAt iQo6/pj8cfKKzh7HCtVbBhDRXlUurVci1svQ/DK2QiVe8en3DLrNSpnFB9TPixvDBxJ4 zd3JW+rqcHTfYdkXp9sZtyQBfkjA2eZJZ6GkCwFPANNzXgS/QXnQEjY4jNJYwmL1XcFX ycDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=Kad4ZY9ePUUjxE6cG0Ohu6IttUMj2XapCpzOQmhkPI4=; b=juwXurhU/9s4TpuUINWImToj6b1p48y5LgDBerOwLtPaxJSmIbLyGwTPSxzRPla5K9 50quam0oucljPoz1gQsq02ZoELQMv2pz4U2tajZonrA7+fXYq5QRQ5IbzxFUTZmwhmEY ESwKqCewg4whDkzxlLzhA4eSxK8x3gvsZIp6d6oI0xkr2AB2y5V//DOW0cMwtsluZdbv Xts/QDYbptHxjE+zidXTpWQNAstFy0ct8poyzQw4NONoZ6wDC5s2h8HUpNhKaZJeRVv3 I55Z7ZiGPcdN7R7iJ52kLYb9cREmblUhWcPM5Ivj6yJn/rEDli8whuEdsN0jNKLocuFR hNjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a639247000000b004915c5ca6b1si22553847pgn.866.2022.12.30.16.01.33; Fri, 30 Dec 2022 16:01:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235786AbiL3Xww convert rfc822-to-8bit (ORCPT + 62 others); Fri, 30 Dec 2022 18:52:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235777AbiL3Xwo (ORCPT ); Fri, 30 Dec 2022 18:52:44 -0500 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 811301E3DE for ; Fri, 30 Dec 2022 15:52:42 -0800 (PST) Received: from omf01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6D3EE120489; Fri, 30 Dec 2022 23:52:41 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA id 59E7160009; Fri, 30 Dec 2022 23:52:39 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: Ignore ETHTOOL_LINK_MODE_ enum values From: Joe Perches To: Gerhard Engleder , linux-kernel@vger.kernel.org Cc: apw@canonical.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Date: Fri, 30 Dec 2022 15:52:38 -0800 In-Reply-To: References: <20221230195907.3959-1-gerhard@engleder-embedded.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Rspamd-Server: rspamout06 X-Rspamd-Queue-Id: 59E7160009 X-Stat-Signature: x1ap8r3swazqgk9wj8cuxtjyjnnf1kqo X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+/m6L9+OI7o7qZKALy4lC6SaCkmA5inmU= X-HE-Tag: 1672444359-641937 X-HE-Meta: U2FsdGVkX18Y7/EWZeImEsDLuzR7KY13D1g8JvL2yIF2FrJXokEsNsSIiF8dmcmhzkNG5LBx5sKvHHVXvaaxkg== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2022-12-30 at 22:15 +0100, Gerhard Engleder wrote: > 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? Maybe $var !~ /^ETHTOOL_/