Message ID | 36069dac5d07509dab1c7f1238f8cbb08db80ac6.camel@perches.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2426783wrn; Tue, 24 Jan 2023 15:36:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXuu5Zy7dHQTRmxvRSWxIt+NBA/YRxRB76h4TfthQIIo3KOZnF91M8vd+4xSez5F2h8rzZWA X-Received: by 2002:aa7:85c4:0:b0:58d:bb58:e928 with SMTP id z4-20020aa785c4000000b0058dbb58e928mr28144014pfn.32.1674603376013; Tue, 24 Jan 2023 15:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674603376; cv=none; d=google.com; s=arc-20160816; b=s8jEZLQKa6ObjHGL3+ubZ2I3J7f8tGb8Y/Ky5n37AhzroCOQw7NjBQrRxmT7Iy/GOt /6e3rDAlnMeC0d/s0EDmMdb5U+yOJd+z9Z40BoSjcabNufqe/2sQbapE6WzMS5BLL5xj Kwa+nb3EwCxElrQKIjxFxBX73ldKMfx8NVBPAP5QwyuVw4J9ah+nRyev0O/9Xu12SsNW brJABShHvBO8eJzbQI75IEgjOl26F3wEhbMYAxmJ5M5vOVCJxy03G136rdNhmHwCv4+q LRYGvtSmETh4RhSeIw/w//PA4nVlqcgglA+9Ibdmyp+QIlg0V1tPt3PgKvrZS/iIF8vu 3vbQ== 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=nhsju1+Iz7rJDu6f1CAqo3Qz/HADPMxE6QAjshUCdcA=; b=rAWEEs1fFPtCVK1MY5NoWbGJVrOJXkF/VyKG7nY8SXjnBkFHCyDAfVuqZBNF5CxxAE Zehe0xL6EdHkeM7wDndYCRhw/uCnizDiMRTXD6y3iXmoqwsy62E+WVHEZDoqI1TUXZzd ngn9kXRntv4/7TiIMywDEl+Z8Gt/XmW8eL9XJoWzkeRUaiNZMJXV8yLcD6GktGCDw/5N NatOMNAd7kFboLpppWYIhiYxi3R1WVIXHSenDFqg44eJmfo64QfJznt64pDsiUrCBqzI t+EJo28QzxX6c13jtuHu0HO639ivt9BrDoCcIbUSjEHAZygYNJDuajVwCDD+G3XOSk/v be1Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p19-20020a056a000b5300b00547d55a4d3bsi3870825pfo.285.2023.01.24.15.35.36; Tue, 24 Jan 2023 15:36:15 -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 S233860AbjAXXRE convert rfc822-to-8bit (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Tue, 24 Jan 2023 18:17:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbjAXXRD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 24 Jan 2023 18:17:03 -0500 Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96A694F341 for <linux-kernel@vger.kernel.org>; Tue, 24 Jan 2023 15:17:01 -0800 (PST) Received: from omf13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 7C346AB323; Tue, 24 Jan 2023 23:17:00 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA id 197112000D; Tue, 24 Jan 2023 23:16:56 +0000 (UTC) Message-ID: <36069dac5d07509dab1c7f1238f8cbb08db80ac6.camel@perches.com> Subject: [PATCH] checkpatch: Improve EMBEDDED_FILENAME test From: Joe Perches <joe@perches.com> To: Heinz Mauelshagen <heinzm@redhat.com>, "apw@canonical.com" <apw@canonical.com>, Andrew Morton <akpm@linux-foundation.org> Cc: LKML <linux-kernel@vger.kernel.org> Date: Tue, 24 Jan 2023 15:16:55 -0800 In-Reply-To: <CAM23VxrnywdK2BW9MurPqa9bAmzeM42oUtH=LFdabgvjrP-hrw@mail.gmail.com> References: <CAM23VxrnywdK2BW9MurPqa9bAmzeM42oUtH=LFdabgvjrP-hrw@mail.gmail.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-Queue-Id: 197112000D 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-Stat-Signature: 4i5n3hg93edqeco6xjbitqofqjzdgpmf X-Rspamd-Server: rspamout05 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+ElIneKqzk8BOiFcZlPbCWae08MyF3kNs= X-HE-Tag: 1674602216-665982 X-HE-Meta: U2FsdGVkX1+h9CH2AcKFseB6jVNxUVyOQh/SZL70vg9OIdXIq29f/2LBbTHQRBbO+zLFyAbwXNNyXQgVOkMFuw== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755948909503377756?= X-GMAIL-MSGID: =?utf-8?q?1755948909503377756?= |
Series |
checkpatch: Improve EMBEDDED_FILENAME test
|
|
Commit Message
Joe Perches
Jan. 24, 2023, 11:16 p.m. UTC
Privately, Heinz Mauelshagen showed that the embedded filename test is not specific enough. > WARNING: It's generally not useful to have the filename in the file > #113: FILE: errors.c:113: > + block < registered_errors.blocks + registered_errors.count; Extend the test to use the appropriate word boundary tests. Reported-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Joe Perches <joe@perches.com> --- Heinz, next time please make sure to CC linux-kernel@vger.kernel.org scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a6d6d7e1d0cf1..40102bc0ce535 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3727,7 +3727,7 @@ sub process { } # check for embedded filenames - if ($rawline =~ /^\+.*\Q$realfile\E/) { + if ($rawline =~ /^\+.*\b\Q$realfile\E\b/) { WARN("EMBEDDED_FILENAME", "It's generally not useful to have the filename in the file\n" . $herecurr); }