Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7290105rwd; Tue, 6 Jun 2023 08:42:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Cc6CfHwvI4O4ukt/i0A2h/qh6GsrCX3zYQ88tBZkk0p8PVurJmaPJjyi+cF7oWaVEEQbE X-Received: by 2002:a05:622a:251:b0:3f5:80b:4724 with SMTP id c17-20020a05622a025100b003f5080b4724mr3086837qtx.68.1686066174847; Tue, 06 Jun 2023 08:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686066174; cv=none; d=google.com; s=arc-20160816; b=YRpb4l+IbliqvfyU+EuKwZ+0H1ww6cLTo5lgPyl1RccJLL7gT8x1Pwi6hFP4mVkStz 4/HE1oTnhtKvnJbgHoe2TwNDZaLbsNHAqrAZzJ06XMVuXnwz16tLa5IeX8PtFZlCVtZi 0RvwDqVb+kvZ7u7T2Q+G9AexI8GeewIHhSVPDwA0bPd5c6x9KlRq2ThfbXRa8tY7g1XJ RAKn4flvyMTWK1YgmftQ0AJT3NmDX0ZZQPDKpKsOjQoYxclpA5krsI91XFad3UfOnkYi E/KEGs3oR5h37vtN7tlR4EadOp9jc+wRnGDS08zSjCnzQ4+13U/cacsF8yymmnbVPSUT 2R7A== 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=ta7NLESscPz1RpIk2BPhnuw4ZP8aidyqqZM6EYaFkus=; b=AcahQK6HCF1I+FqN0rDBVZlw/wP3znRhKR0sJh3D8g9AeD0eDTQahl5iAUTWeHVuRf GxCfcPVearhhVfZqyPQe8KT4YAQLIJQkFrRsNWkGiy9wYv3M7vty9xWDPlrqdF39awvx XktRceiV7IyK4zD/IH5RZZbphNoIi4wxGlOZrgJCJLh9DEl824pvRIr8fSmsGHYTR9UQ nHgeYhZD5uO6Xo7k4DK65nbSpLlq42cYvootDXV+s+hyo8oCsQNARsTvhrdbHKFs19b4 pKcCUBSlyqubyCovONRz/4h/DruZ1frrzbeK2vc/H4MZPATfZWpZcjZ8lWnbRzA9nfTD v92w== 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 p19-20020a05622a13d300b003f8704f386esi3726756qtk.652.2023.06.06.08.42.38; Tue, 06 Jun 2023 08:42:54 -0700 (PDT) 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 S237737AbjFFPLO convert rfc822-to-8bit (ORCPT + 99 others); Tue, 6 Jun 2023 11:11:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233277AbjFFPLN (ORCPT ); Tue, 6 Jun 2023 11:11:13 -0400 Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A9D91B5 for ; Tue, 6 Jun 2023 08:11:11 -0700 (PDT) Received: from omf19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6CC35160658; Tue, 6 Jun 2023 15:11:08 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA id 487DA20029; Tue, 6 Jun 2023 15:11:04 +0000 (UTC) Message-ID: <9717acd3dd00d607da718da251a0bba6b376da96.camel@perches.com> Subject: Re: [PATCH] checkpatch: check for missing Fixes tags From: Joe Perches To: Dan Carpenter , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn , linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Arnd Bergmann , Kees Cook , Sasha Levin , Tom Gall Date: Tue, 06 Jun 2023 08:11:03 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.48.2 (3.48.2-1.fc38) MIME-Version: 1.0 X-Stat-Signature: e8yizfse93tg34wrnxuks1axdeyptqji X-Rspamd-Server: rspamout07 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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Rspamd-Queue-Id: 487DA20029 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+javYTQk+znKLFunfTX/GuQNyDwql5ppE= X-HE-Tag: 1686064264-172003 X-HE-Meta: U2FsdGVkX1+eUvA1i0Fj9NdSdrQT4hO2mjQv92PtA4kgpE592e6rAUI3ME5m6kc/aR+LitmPRJmYeBdyse8MSNXulh2JgBTfY3OeW3bBqx5wxzTRqYbJe1QT0sM58LArvNmrF2Vm2++3q9Tw5hhUtlwGAb4Jchkgz/O/FLUmU3KycC7FahjjhIKIr7B+V1HaZok109BExatA9FZr1OdBXhBIr1262F5TXYb8tEcz5M0Tu6y+TP9OZi3sEekDA+5iSXwwZSV32nD49EWBuhPwwRuRTdEOWPDqZzN0GIsvAtFj++Kt1iOcHoFLWrZ3qNLG 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 Tue, 2023-06-06 at 11:30 +0300, Dan Carpenter wrote: > This check looks for common words that probably indicate a patch > is a fix. For now the regex is: > > (BUG: KASAN|Call Trace:|syzkaller|stable\@) Seems sensible. Style notes: > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3186,6 +3192,12 @@ sub process { > } > } > > +# These indicate a bug fix > + if (!$in_header_lines && > + $line =~ /(BUG: KASAN|Call Trace:|syzkaller|stable\@)/) { > + $needs_fixes_tag++; Align to open parenthesis please. Maybe add "Closes:" This should not check any actual patch lines. So this should likely use if (!$in_header_lines && !$is_patch && $line =~ /\b(?:BUG: KASAN|Call Trace:|Closes:|syzkaller|stable\@)/) { There's no use of $needs_fixes_tag as something other than a bool, so please just use $needs_fixes_tag = 1; > @@ -3198,6 +3210,7 @@ sub process { > my $id_length = 1; > my $id_case = 1; > my $title_has_quotes = 0; > + $fixes_tag++; $fixes_tag = 1; here too > @@ -7636,6 +7649,12 @@ sub process { > ERROR("NOT_UNIFIED_DIFF", > "Does not appear to be a unified-diff format patch\n"); > } > + if ($is_patch && $has_commit_log && $chk_fixes_tag) { > + if ($needs_fixes_tag && $fixes_tag == 0) { if ($needs_fixes_tag && !$fixes_tag) { > + ERROR("MISSING_FIXES_TAG", > + "This looks like a fix but there is no Fixes: tag\n"); Alignment to open parenthesis and likely WARN not ERROR