From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05874C4363A for ; Wed, 21 Oct 2020 18:05:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 976492227F for ; Wed, 21 Oct 2020 18:05:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503891AbgJUSF0 (ORCPT ); Wed, 21 Oct 2020 14:05:26 -0400 Received: from smtprelay0083.hostedemail.com ([216.40.44.83]:56340 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2438566AbgJUSF0 (ORCPT ); Wed, 21 Oct 2020 14:05:26 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 49EE8181D330D; Wed, 21 Oct 2020 18:05:25 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: power34_130717c2724a X-Filterd-Recvd-Size: 2295 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA; Wed, 21 Oct 2020 18:05:24 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: fix false positive for REPEATED_WORD warning From: Joe Perches To: Aditya Cc: linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, dwaipayanray1@gmail.com Date: Wed, 21 Oct 2020 11:05:22 -0700 In-Reply-To: References: <20201021150120.29920-1-yashsri421@gmail.com> <26647abf8cf14595a0dd22f10ec1c32e3dc2a8c0.camel@perches.com> <40ca3f0f9a960799ad0e534b77d778c90119e468.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-10-21 at 23:25 +0530, Aditya wrote: > Thanks for your feedback. I ran a manual check using this approach > over v5.6..v5.8. > The negatives occurring with this approach are for the word 'be' > (Frequency 5) and 'add'(Frequency 1). For eg. > > WARNING:REPEATED_WORD: Possible repeated word: 'be' > #278: FILE: drivers/net/ethernet/intel/ice/ice_flow.c:388: > + * @seg: index of packet segment whose raw fields are to be be extracted > > WARNING:REPEATED_WORD: Possible repeated word: 'add' > #21: > Let's also add add a note about using only the l3 access without l4 > > Apart from these, it works as expected. It also takes into account the > cases for multiple occurrences of hex, as you mentioned. For eg. > > WARNING:REPEATED_WORD: Possible repeated word: 'ffff' > #15: [] > I'll try to combine both methods and come up with a better approach. Enjoy, but please consider: If for over 30K patches, there are just a few false positives and a few false negatives, it likely doesn't need much improvement... checkpatch works on patch contexts. It's not intended to be perfect. It's just a little tool that can help avoid some common defects.