Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2527940rwn; Fri, 9 Sep 2022 15:33:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR5L+ITYUo8KDc31MkxEgYjWKhvTrR0grLXL9FBSiHUoCiOjbUtk8I7hgkXmpg2xbMMsGdbN X-Received: by 2002:a17:903:2285:b0:177:ab99:9e5 with SMTP id b5-20020a170903228500b00177ab9909e5mr13866651plh.121.1662762790052; Fri, 09 Sep 2022 15:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662762790; cv=none; d=google.com; s=arc-20160816; b=rFaJIsVur9Yc2xXRwciPMbHjNSoq1jWbNWZSWJJiNqlS5zW92U91Kq6SS7rzdFNW5n uIhZrAWXh0gq6DK1m0YXBZ5foikBmX0h2gQgi83C7IwONRymGiWx4+ToZjPlyFy58Df9 9EQeFeK0T693CyStoQogVKigaZLzZR1J+Snozd0aCWOlXaBZ5JNePrG2Fx3c8phY1atk dJoyOSqePNwd8HAami0k97jqu0XVdbIAywcLtAGXbUE2Gkpsxkg87EsX8HG6Ts/oTvtD /E/7QU3QUNpSeRn5zxWArtV3+fpMsz9Npydt+/o3tuYtpYaLYs00GVDxLsusxYOYP/Ck mQqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:mime-version:date :content-transfer-encoding:references:in-reply-to:cc:to:from:subject :message-id; bh=NjJEiGXh+4OrstKLep7GYrC3zbxDKgGLw2G2kk5uYNY=; b=FpLrMALrbvuColKyfu2Vt8+23PuTjeUSvcKDIZqnn/mL0JhL4tTawet6Q+f38hcgdD F6BVN8KXtC73EXxQaxAW7/aZ01L53F+9WIMmRkbptJ3e38CA2AsQfPlRwVwyFFudsvpB YImIPKL6rc1CIzFPGCwPxKw70J269cbOpDT3KlXe78xO812854937FrtKQwjv0+AxEby BGReQOi4808dYQwTpmg3Iq16FqjUCRmkv1dBBCqycUGUV0tytUDeGZUPOa3mjdzCpN0r 3f5jp3JQX3GMJZz/Kff+UgF/Zm+DPp/8/VLkIOoIQaA+TkPGaJI1j3U5WJ9Qv+KLsD9/ oxzQ== 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 g10-20020a63520a000000b00434e51fc654si1669281pgb.685.2022.09.09.15.32.58; Fri, 09 Sep 2022 15:33:10 -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 S231395AbiIIWQM convert rfc822-to-8bit (ORCPT + 99 others); Fri, 9 Sep 2022 18:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbiIIWQK (ORCPT ); Fri, 9 Sep 2022 18:16:10 -0400 Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B9B8D6BA6; Fri, 9 Sep 2022 15:16:06 -0700 (PDT) Received: from omf19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 43AD740CC1; Fri, 9 Sep 2022 22:16:04 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA id F18B220028; Fri, 9 Sep 2022 22:16:01 +0000 (UTC) Message-ID: <9f9a0740aef282d30af8fa02ca7c6479e80aa9a0.camel@perches.com> Subject: Re: [PATCH v4] checkpatch: warn for non-standard fixes tag style From: Joe Perches To: "niklas.soderlund@corigine.com" , Philippe Schenker Cc: "corbet@lwn.net" , "dwaipayanray1@gmail.com" , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "lukas.bulwahn@gmail.com" , "apw@canonical.com" , "sfr@canb.auug.org.au" , "louis.peens@corigine.com" , "simon.horman@corigine.com" , "oss-drivers@corigine.com" In-Reply-To: References: <20220908164434.122106-1-niklas.soderlund@corigine.com> <3275d886491dc934e3277cde9cc766b0ce0886ea.camel@toradex.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT Date: Fri, 09 Sep 2022 10:57:10 -0700 MIME-Version: 1.0 User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) X-Rspamd-Server: rspamout07 X-Rspamd-Queue-Id: F18B220028 X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: m91rttnmjcyc9hp6u7nq9q8fgs9shggn X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX181w+JFSHc52oJAFzxomZOE5ihG4vTbwGs= X-HE-Tag: 1662761761-371326 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-09-09 at 09:40 +0200, niklas.soderlund@corigine.com wrote: > On 2022-09-08 17:49:14 +0000, Philippe Schenker wrote: > > Thanks for adding me to cc. I will also add Stephen, as he also sent > > some comments on my submission the exact same problem. I'm supportive of > > your code as it has the nice advantage of suggesting the right format of > > the tag if it might be wrong. However it seems lot of stuff is slightly > > duplicated and lots of lines could be left away simplifying it greatly. It's not very possible to reduce the line count here. I mentioned the same thing in my first reply. > > > +# Check Fixes: styles is correct > > > +???????????????if (!$in_header_lines && $line =~ /^fixes:?/i) { > > > > I would check all lines that start with fixes, even if there is > > whitespace in front (and then failing later on...) > > > > if (!$in_header_lines && $line =~ /^\s*fixes:?/i) { I think that's a poor idea. You should really review git history for lines that start with fixes and look at the number of false positives that would give. Try this grep: $ git log -100000 --no-merges --grep="^\s*fixes" -i --format=email -P | \ grep -P -i "^\s*fixes)" | \ grep -P -v "^Fixes: [0-9a-f]{12,}' [...] That is a greater than 10% false positive rate. I think it's better to make sure that there is a likely SHA1 of some minimum length after the fixes line. And a relatively common defect is to have the word "commit" after fixes. e.g.: Fixes commit 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver"). Fixes commit a2c60d42d97c ("Add files for new driver - part 16"). So maybe: if (!$in_header_lines && $line =~ /^\s*fixes:?\s*(?:commit\s*)?[0-9a-f]{5,}\b/i)