Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp90312imm; Thu, 26 Jul 2018 14:32:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqljUI2cu3vzY82XM3HXTIxhx6jSnBq4gvEibtbDrqAY80lbZ1F7gaAXepCxj/iTjhNhRR X-Received: by 2002:a17:902:900b:: with SMTP id a11-v6mr3444992plp.143.1532640749469; Thu, 26 Jul 2018 14:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532640749; cv=none; d=google.com; s=arc-20160816; b=NxF49lgRHLuraBa0bSc8nuhxPjwtG13IRT/ngtJFSOGI/b/D8OQ8M/ahBtvS2patnQ +lSWftlxwJRpj+SL4sCwOk8nIBXUamyHYsWEACGU/KZvS9hov4ySKFHctrEJtR27O6LL VucbM87SoS4uMJw+S9syT0oCIPd0EBnJpx10eOktCmcm76zEMiRrm+y5tMcFXd8TeF1p PYd+EZStSUNNpz0CYUyl1YDGqvdPkqgYURHpCshgd4PaHd4+5m0G9KIE1S5ND0sTqGfz 0QpSfkVyb89pftRCPixr9bqpSVFeV8H7xiMCu1YNIBSMoqKhegBaW44L0jkqAh7BxQa7 UhKA== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=WpD9gQ8HoVFjDbLc1/NI0b8BWfAl/gVD3oVvFhxLlhk=; b=lrjPIlWb6ks3xlAqg3hwXz7VZHUPRWtrxcXJ3S2yEq0sm2mYYtLLquLP6CUoI0ee1R ODFwp+X6wNqSWZGMoR3wHDnTSnk40qtGAIFDUhHRtPX7tV+CHAshrQydldFHcwX7OaQk +qo28nKFP7tRx4HGq2FQ1ZteKp+ne9EfhWCDAQFt+aZss7Vpht57byfFmhPGv+tqpFbo aVMQsC9a7hwI9nuSQD7eprrQzdxIFU6jg5yIcxeBtOzoNf2WReRoQGCXMN1E67FUs4d4 3z9CXP+/fU3/lkU6WvDyg2+4wsbdYjK14UznFiXje9z6m70/a3PZKdCpIGy99Yg3fUPc nF6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v190-v6si2179399pgd.668.2018.07.26.14.32.11; Thu, 26 Jul 2018 14:32:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731490AbeGZWty (ORCPT + 99 others); Thu, 26 Jul 2018 18:49:54 -0400 Received: from smtprelay0072.hostedemail.com ([216.40.44.72]:52060 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730581AbeGZWtx (ORCPT ); Thu, 26 Jul 2018 18:49:53 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 0B7C1180A8149; Thu, 26 Jul 2018 21:31:13 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3872:3873:3874:4321:5007:7903:10004:10400:10848:11232:11658:11914:12295:12679:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21060:21063:21080:21451:21627:21740:30012:30054:30070:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: lamp71_61b555fb3c43e X-Filterd-Recvd-Size: 2157 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Thu, 26 Jul 2018 21:31:11 +0000 (UTC) Message-ID: <4a8c5a82369787869ec52667397e61b6f619b08f.camel@perches.com> Subject: Re: [PATCH v2] checkpatch: check for #if 0/#if 1 From: Joe Perches To: Prakruthi Deepak Heragu , apw@canonical.com, Andrew Morton Cc: linux-kernel@vger.kernel.org, ckadabi@codeaurora.org, tsoni@codeaurora.org, bryanh@codeaurora.org, Abhijeet Dharmapurikar Date: Thu, 26 Jul 2018 14:31:10 -0700 In-Reply-To: <1532625218-24321-1-git-send-email-pheragu@codeaurora.org> References: <1532625218-24321-1-git-send-email-pheragu@codeaurora.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 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 Thu, 2018-07-26 at 10:13 -0700, Prakruthi Deepak Heragu wrote: > The #if 0 or #if 1 is used to toggle features. Warn if #if 0 or #if 1 > is present and suggest that they can be removed. > > Signed-off-by: Abhijeet Dharmapurikar > Signed-off-by: Prakruthi Deepak Heragu Andrew, can you please move the misplaced periods below to the appropriate positions? Otherwise: Acked-by: Joe Perches > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -5383,9 +5383,14 @@ sub process { > > # warn about #if 0 > if ($line =~ /^.\s*\#\s*if\s+0\b/) { > - CHK("REDUNDANT_CODE", > - "if this code is redundant consider removing it\n" . > - $herecurr); > + WARN("IF_0", > + "Consider removing the code enclosed by this #if 0 and its #endif\n". $herecurr); This should have a space before the . and only one space after. > + } > + > +# warn about #if 1 > + if ($line =~ /^.\s*\#\s*if\s+1\b/) { > + WARN("IF_1", > + "Consider removing the #if 1 and its #endif\n". $herecurr); here too > } > > # check for needless "if () fn()" uses