Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7734960rwl; Fri, 30 Dec 2022 13:38:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXuXcyKBmwPB0eaIfxZ8NU7wSe6PkR/cQfplVJHot+9SsOlPu47n8NklRKAYmLeqJoSI9Wlf X-Received: by 2002:a05:6a20:7b25:b0:a2:e391:f8f3 with SMTP id s37-20020a056a207b2500b000a2e391f8f3mr49277741pzh.34.1672436326461; Fri, 30 Dec 2022 13:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672436326; cv=none; d=google.com; s=arc-20160816; b=ELKso8Wswh4+1KEaoxRQXz1VW7GOwiGLw7KEQa94VE6PB+25ZLkME8N4TId86Ijxr0 4JPIk/K1f3YS7TjKoix4Qz3oaf/GbNIQVt9jj3n6MiS0vQ2EdluKfE5FQzqkUVbUcOUY E5bjgfBDnerKg2CWuYOvrHGu9kk1cjWxXRaF/JQA0n9umbXQyOaGy0gLeNPkx1fIwSTq pz0mSf6qtP/hAHlvXzrXOXvm1gMMMe2TkcAYSZ3hA8E/KU8H2Q+7HDK3t4gyxB+fN8XY c2oEPjntocKuU2CZLxJRUhGunvu9SPYVK3yQPKaczJ2q4T/bOl+4Foz5Sm9A/aklEtYF XEcQ== 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=CgCYt/sfMK8qb0QaeDgHdbxZlUMez8SDPh/QECUUZhU=; b=lp6ZKcA6dDuqKx1JZMPnzsNbWiqUKxZkpwUQqCl17qMUO4UL/S11Ac6pN8Gx9lVQ40 gaYtLlIkiAnUvTo9Trz8nVYw7i2YEJU4tf09cTWOjd8XsCIDKfvAREJPmjVieWXSMFGk ewEmZtrI/zDjkGuzbgwhmXryrlvVEQDJSV6BS4gZbnlkQhW07Ee61ztfAck8RTzCnZr0 pXhOnBx7OuVs7h/fJun1AHDtKAYNrSk1fK0+v35Q2BwSvX0+ks4ERp1+K+OgPS9FeuSR Hgqx4V2zAUIaHw7ExGqy3rQak7enQT1SE/nZc1GcnLmYUbKcP0qyWKP07FnvgMBXA1Iq BaoA== 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 o4-20020a654584000000b00478496a1373si22754857pgq.382.2022.12.30.13.38.38; Fri, 30 Dec 2022 13:38:46 -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 S234991AbiL3UbV convert rfc822-to-8bit (ORCPT + 62 others); Fri, 30 Dec 2022 15:31:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbiL3UbT (ORCPT ); Fri, 30 Dec 2022 15:31:19 -0500 Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5958A1BEAF for ; Fri, 30 Dec 2022 12:31:16 -0800 (PST) Received: from omf17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 91D838062C; Fri, 30 Dec 2022 20:31:15 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA id 8E4A417; Fri, 30 Dec 2022 20:31:13 +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 12:31:12 -0800 In-Reply-To: <20221230195907.3959-1-gerhard@engleder-embedded.com> 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: rspamout04 X-Rspamd-Queue-Id: 8E4A417 X-Stat-Signature: 6c7kbpugjqrakk77jerpgxpnqceyn17h X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, KHOP_HELO_FCRDNS,SPF_HELO_PASS,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18WaoOBECKN3jdCj3OziHkn6rV+G7XoXbc= X-HE-Tag: 1672432273-637006 X-HE-Meta: U2FsdGVkX18b2nRnj0EOYK/YS7XaZAovrA0BZ1YscJryBYS1IdAZypfZ2zC1/sci4qGDvIcoDZTE2r3YnhBk7g== 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 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. Try a git grep using that pattern and see if all the matches are actually what you want to allow $ git grep -Poh '\b(?:[A-Z]+_){1,5}([A-Z]{1,3}[a-z]|[0-9]+[a-z]+[A-Z])\w*\b' -- '*.[ch]' | \ sort | uniq -c | sort -rn ...