Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7722358rwl; Fri, 30 Dec 2022 13:20:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXsZLhuOMIQY8VF/pDZxNPWFDmVjYC/RNbMbAoyE+xdY776cQY34I5ZMSpnDsYlgvjLrh47B X-Received: by 2002:a17:906:595a:b0:835:57c9:6431 with SMTP id g26-20020a170906595a00b0083557c96431mr31128154ejr.68.1672435209937; Fri, 30 Dec 2022 13:20:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672435209; cv=none; d=google.com; s=arc-20160816; b=QpRAdDKIcFfQm6vFdkLpGw198VnU4RkJax3BxcXKG3tUNKi+GjYdb74LfaGgfCVqIA 7EpAKca7a6PhJeNeRu5bYLqa9J+RZrGtGAHmc6ySciI7O2dC65cfW8sdSQXRCdJhE2zC mNAcMfPvTxyzS18rNeBWml1WJeAZyDVPlarQVyGKvoWVZ/ze9HRp0NsBD2Vopchf5XYE eUPej3dNMv8xkrO25FCMABkLxqglT1geMyGrAvk9bcHdERKgaKb2AwjZuYJnq4YF0Fl+ U/WAbnR5k87/AKwcc2NyMEjGyxOnJIAZMuG6qdzzM3QqWxuwRKhKN0zfaIzYIBz1DZCW QLGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=wgQFiKRrPj0iVoG9wI+hMA5E5xdb5lHyTH4epgK/EZE=; b=G2y95e/DqRm/JntO07MiTOwfAHgnWib+8Havgs09mXyYMGU09DQ6e//i7siSpvA8aV ZP4ElEWeDcX1wsJOGdsvw9ufYDrKzQAQOufpjxgZUMbsZCAK4AFdgjs+QzQN02ae25np 8SExIQ4eNZoHDuLnHGlk28fDEC6quT9M6IZkCmL10H5dUQdUT1MFXn/VR0m2mPrFg9Ve 5wO3M5Ga3HIwpQFolPm5ix4PVETQS/P/Xr2+DmZvZmEssRRpejFPFdx0XKUz6+8eK66m RHIKao9uUZTtGGN6eEE/oYu+20zhoCK8jrl2pkDPOK4VWyub9W2LWMQ7xqGWxbijl5Oy oU+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@engleder-embedded.com header.s=dkim11 header.b=EY103WKF; 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 ae4-20020a17090725c400b007c10e7a7628si18730116ejc.839.2022.12.30.13.19.53; Fri, 30 Dec 2022 13:20:09 -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; dkim=fail header.i=@engleder-embedded.com header.s=dkim11 header.b=EY103WKF; 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 S235572AbiL3VPa (ORCPT + 62 others); 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 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 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