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 43701C4363A for ; Wed, 21 Oct 2020 20:37:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAD9C22248 for ; Wed, 21 Oct 2020 20:37:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505399AbgJUUhC (ORCPT ); Wed, 21 Oct 2020 16:37:02 -0400 Received: from smtprelay0161.hostedemail.com ([216.40.44.161]:45718 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2410722AbgJUUhA (ORCPT ); Wed, 21 Oct 2020 16:37:00 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 57D7B181D3058; Wed, 21 Oct 2020 20:36:59 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: verse65_2d0591e2724b X-Filterd-Recvd-Size: 2997 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA; Wed, 21 Oct 2020 20:36:58 +0000 (UTC) Message-ID: <05ace32973590e28f62ccddfd7874cf1fcaca8b1.camel@perches.com> 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 13:36:57 -0700 In-Reply-To: <5bacf91085ce7e253b2697333dc8ff0378fcfae9.camel@perches.com> References: <20201021150120.29920-1-yashsri421@gmail.com> <0562c42d-f9af-1141-ab77-8abb73bfd31f@gmail.com> <5bacf91085ce7e253b2697333dc8ff0378fcfae9.camel@perches.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-10-21 at 12:26 -0700, Joe Perches wrote: > Perhaps a regex for permissions is good enough > $line !~ /\b[cbdl-][rwxs-]{9,9}\b/ Maybe not completely correct... >From info ls: The file type is one of the following characters: ‘-’ regular file ‘b’ block special file ‘c’ character special file ‘C’ high performance (“contiguous data”) file ‘d’ directory ‘D’ door (Solaris 2.5 and up) ‘l’ symbolic link ‘M’ off-line (“migrated”) file (Cray DMF) ‘n’ network special file (HP-UX) ‘p’ FIFO (named pipe) ‘P’ port (Solaris 10 and up) ‘s’ socket ‘?’ some other file type The file mode bits listed are similar to symbolic mode specifications (*note Symbolic Modes::). But ‘ls’ combines multiple bits into the third character of each set of permissions as follows: ‘s’ If the set-user-ID or set-group-ID bit and the corresponding executable bit are both set. ‘S’ If the set-user-ID or set-group-ID bit is set but the corresponding executable bit is not set. ‘t’ If the restricted deletion flag or sticky bit, and the other-executable bit, are both set. The restricted deletion flag is another name for the sticky bit. *Note Mode Structure::. ‘T’ If the restricted deletion flag or sticky bit is set but the other-executable bit is not set. ‘x’ If the executable bit is set and none of the above apply. ‘-’ Otherwise. So apparently to be correct this should be: $line !~ /\b[bcCdDlMnpPs\?-][rwxsStT-]{9,9}\b/