Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp590220ybi; Wed, 3 Jul 2019 01:31:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMEoa+9+DFnI8ED5uMkWCYLknyA3n6oRZ2eF6YOb6lhYQUVmWhy0JJ0Lwpt5/w2ZCZKRqC X-Received: by 2002:a17:902:296a:: with SMTP id g97mr40185968plb.115.1562142682064; Wed, 03 Jul 2019 01:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562142682; cv=none; d=google.com; s=arc-20160816; b=RAvRMd9CmMX8Il5V8WMz3WRHPJqJ/CdbMYJh+dnCCNDViZANCEsPvei9RSAlcGDkNv 9jrZW/X88K23otJzEuFpOBb1XiK57uvKrfSnnH+FKCT4WQT7LfDgmA+wd+2uIMwQFE7r gy/2xFgqoSm0EwTBNgnFqSRW0Czv1ZaeXxp2jERjIp6gEisYa/pNLNj1dsv6pPEutJ4/ uMSINX1uUoqFYMFiH5OmuQ7pB4Wug5FX0ZEgz+njtH+j4UoDKPY+w/B3lj/76Ip5BVjt 4zAqYSBxohB7yfbW5hqXWedx52HwFgCWEpBUpydvXz5Gh2f3RCAxeslSGq3MKBdixaWI 3sdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=KDubKvdBowYbJRghD8aAE78pzovWthTF5zozQLTnOFw=; b=KPsZ8aWTzN7Ka8jpizLbfu0hXa9I0a3hNylJefKo4djY9AUi5G5wBhfl2E9NElhUFn msXzcRXFxXJM22vLbkAIKNeIzB4kR6oFvKzYIPa1AQzYHgohZamnDAj0iTh8TQQ0Cq5G 3uRs0J8TfN1GSIzLOqUYlQz8yk4UaDhPaZQhJ1gB7qZ6H4J7uqhZgQ507pDm5N7fxh2X xNJNQMGkURZqsgNOg9NssXq9GW9OoIVK3B4jxYR7J7eFiQyAORwHfHx65CT0zbm2MIwJ szY0G07rahswn1BT1BJfjXP2UgqCTxezHOHQco+zeUk1iourQr9huShOiV6TEEUMNWtu DpXw== 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 x4si1743658pgh.292.2019.07.03.01.31.06; Wed, 03 Jul 2019 01:31:22 -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 S1727188AbfGCIal (ORCPT + 99 others); Wed, 3 Jul 2019 04:30:41 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:28547 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727004AbfGCIal (ORCPT ); Wed, 3 Jul 2019 04:30:41 -0400 X-UUID: d53c660dd6324e06b80c195c314dc690-20190703 X-UUID: d53c660dd6324e06b80c195c314dc690-20190703 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1792083996; Wed, 03 Jul 2019 16:30:33 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 3 Jul 2019 16:30:32 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 3 Jul 2019 16:30:32 +0800 From: Miles Chen To: Andy Whitcroft , Joe Perches CC: , , , Miles Chen Subject: [PATCH] checkpatch: avoid default n Date: Wed, 3 Jul 2019 16:30:31 +0800 Message-ID: <20190703083031.2950-1-miles.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This change reports a warning when "default n" is used. I have seen several "remove default n" patches, so I think it might be helpful to add this test in checkpatch. tested: WARNING: 'default n' is the default value, no need to write it explicitly. + default n Signed-off-by: Miles Chen --- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 342c7c781ba5..6531b5757c6b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3005,6 +3005,13 @@ sub process { "Use of boolean is deprecated, please use bool instead.\n" . $herecurr); } +# avoid redundant 'default n' + if ($realfile =~ /Kconfig/ && + $line =~ /^\+\s*\bdefault n\b/) { + WARN("AVOID_DEFAULT_N", + "'default n' is the default value, no need to write it explicitly.\n" . $herecurr); + } + if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { my $flag = $1; -- 2.18.0