Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp499919ybg; Wed, 10 Jun 2020 06:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdu20rr79X9BpdYHtcNjxriFuaf0m4wGKZIIvbIGoxXVpEoba9ZWrxY7QR//Q1372L7rJU X-Received: by 2002:aa7:db51:: with SMTP id n17mr2346283edt.241.1591795507022; Wed, 10 Jun 2020 06:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591795507; cv=none; d=google.com; s=arc-20160816; b=KnE0OHygWKDUkaOrUX1P1bWsoPcDFureV3rDUmejkTnfW48En9K5NxNMffsC5Y/Y2z uB5ogMxzmhQ/fgS57S8ynrzjZV2omXxNQV/8Is4TSzLe23r3lgLCR6kX2pqCiDhARQTc pN1LCbvqyUGqgOd3a9Mt+YzHkmmUcISsqmDK4o6+iY9dItDaV/9lyQS5h/c3HVqBLQRU 1m+PkP4isap6DLAvq9rxKPjk3tPrWPHjrs3wmCl3uyHcTXzlvcQ3NN0hymr8ssL0IyaK QkqL5qVTgoYZm0Lf3Q/4A89wRvpfLSy9axoYe5h3J5JiAMkSZpv60cPTLEUk7BR+0QUv sDyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=U3L4zVdAeJtwiyfg+pjMcOgfNMnH7A4WFDzySzpiS1c=; b=H0P/u0bD2pXqXvObun3TOadl3gh8RJkHtNs2xkbkHy8si5by16B+U5m2l8JAHeYr4A VQY8SFe5UUCBx7hlyFBMCbaXXzW9e0XAhZfsUEdsZ/3KlxflrYqm0qMRnkK+V8bCt8CT 69tMpBvV7kQaOn6l2dRcl1+HD97hORr8ik6PhuSRrdOLxjGFcvG0ITvC/tNoTNZ94CeZ hFZ9nNSSRvn/I+e7g19kh/GfhaNsiTJAEYhfNraozPqmIWE65MQ3QYRg/XxyDwP+Sr+t LX0B88tp6+5gA/KGAeOFmlmNNKKPS5ixDF/zHMOevio5OIvw0Gt0VU+ObfnVoEWxG0ZM UsRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id si29si1210ejb.40.2020.06.10.06.24.43; Wed, 10 Jun 2020 06:25:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbgFJHNq (ORCPT + 99 others); Wed, 10 Jun 2020 03:13:46 -0400 Received: from smtprelay0218.hostedemail.com ([216.40.44.218]:46140 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726276AbgFJHNq (ORCPT ); Wed, 10 Jun 2020 03:13:46 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 76A34181D3762; Wed, 10 Jun 2020 07:13:45 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:2895:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:7576:7807:7875:8957:9010:10004:10400:11026:11232:11658:11914:12043:12297:12438:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21451:21627:30012:30054:30064:30070:30079:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: brain48_4312e6726dc9 X-Filterd-Recvd-Size: 2457 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA; Wed, 10 Jun 2020 07:13:44 +0000 (UTC) Message-ID: <016a2c771e5535a872b9f20d90e4cc5683ea7a55.camel@perches.com> Subject: Re: [PATCH v3 1/2] checkpatch: support deprecated terms checking From: Joe Perches To: SeongJae Park , akpm@linux-foundation.org, apw@canonical.com Cc: colin.king@canonical.com, sj38.park@gmail.com, linux-kernel@vger.kernel.org, SeongJae Park Date: Wed, 10 Jun 2020 00:13:42 -0700 In-Reply-To: <20200610065223.29894-2-sjpark@amazon.com> References: <20200610065223.29894-1-sjpark@amazon.com> <20200610065223.29894-2-sjpark@amazon.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.2-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-06-10 at 08:52 +0200, SeongJae Park wrote: > From: SeongJae Park > > Some terms could be deprecated for various reasons, but it is hard to > update the entire old usages. That said, we could at least encourage > new patches to use the suggested replacements. This commit adds check > of deprecated terms in the 'checkpatch.pl' for that. The script will > get deprecated terms and suggested replacements of those from > 'scripts/deprecated_terms.txt' file and warn if the deprecated terms are > used. The mechanism and the format of the file are almost the same as > that of 'spelling.txt'. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > +# Load deprecated terms and build regular expression list. > +my $deprecated_terms; > +my %deprecated_terms_fix; > + > +if (open(my $deprecates, '<', $deprecated_terms_file)) { > + while (<$deprecates>) { > + my $line = $_; > + > + $line =~ s/\s*\n?$//g; > + $line =~ s/^\s*//g; > + > + next if ($line =~ m/^\s*#/); > + next if ($line =~ m/^\s*$/); > + > + my ($suspect, $fix) = split(/\|\|/, $line); > + > + $deprecated_terms_fix{$suspect} = $fix; > + } > + close($deprecates); > +} else { > + warn "No deprecated term will be found - file '$deprecated_terms_file': $!\n"; > +} > + > +$deprecated_terms = join("|", sort keys %deprecated_terms_fix) if keys %deprecated_terms_fix; > + This is a direct copy of the spelling dictionary loading code, so maybe these could be consolidated.