Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6247346ybc; Wed, 27 Nov 2019 18:09:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyPzYzQnBZ3k+abz15/kiRcEfRbDt5cZodeRKYa1dws2khmU22rI0DgG65tahNHD4l4hn6w X-Received: by 2002:a50:fc18:: with SMTP id i24mr35576775edr.41.1574906984511; Wed, 27 Nov 2019 18:09:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574906984; cv=none; d=google.com; s=arc-20160816; b=n/ac1OLzZ1wKxrDgcyat6GM5t8x7tPhEQXACs5ux26vw/ImtRNbm4x78lWWUMbw+As CXaq2fFb2GMJd0HwW0PZ+wlcQE73twDJOuPB7hfOmD55HFCADumF7HG/wRYRJsko1mW4 MrIAF/dWboYNA16fjXGFZFXeK9uXjgFaQq8o8b6zYUmZlKc4OSSkEu6JMfxXfRwM4n3/ plGCP+a0ZaZNBLqZZECIfP41wP1AFaimr/bQCe6cDv9a9RqH8jZL+TvBQXh6VscLNTmV 9OOpoKPRPPql9OeildHAtGnkpYPqmMa8FsohDajZbjcFEyaj4ThC2SZPHfbmyKt5Amit HOJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Z90e0TyLzNIHakjdB6dk9gVJ+xT9Nvgm6VpZITz3Gwo=; b=j+t38NYmtZzg66SKSG4bdFwhT4GAra97OGdgjMwKIc5wA6lXbcyJNraF6WQ9tTL1Lp 4R6Q07QTaArjfjBVWbMTvEJYrIa7SM4YZY8zLqEpGArNKRgdqnp3LPKlsNOPzyWYusF6 WoinPpPCuH1+67rjCn0U1gSU7gAU20rjaefu3WdShh3JqgaImE1nR+Ap5iF+ZRp7I6EV IdfzXFmPNH7Titgx2WaTllAgs6n0JE9BPwF9LUEnAUcdl0Hd9l1wwiP6awPXVknF02LC 27nvDJ6cENSueWs77KQo98lrYNxZlq5s5bbyJv+7zxjfVY+kWWWSdAtOW4r611u6cI1A mMNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Di5Maj68; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20si11427285edn.178.2019.11.27.18.09.20; Wed, 27 Nov 2019 18:09:44 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=Di5Maj68; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729166AbfK1CIY (ORCPT + 99 others); Wed, 27 Nov 2019 21:08:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:40386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728146AbfK1CIY (ORCPT ); Wed, 27 Nov 2019 21:08:24 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C902D2154A; Thu, 28 Nov 2019 02:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574906904; bh=bp45aXGFjLrhjBcmTTO7+khobR3wD855ApCRaekjeQ4=; h=From:To:Cc:Subject:Date:From; b=Di5Maj68FHJk8SQ5s6VUDmLNANWgkwq0mu8yKX933PKNG844Jo2XWjqzKElVCLoq8 7bnve5yw+bogztNHZcfW2Rv+HUQj6Iz+5zzz015XdZuqczFRgbIw3OjXdr/LGpuZgR rHEm9xuEN23tJSaLtihTO8sG1tWYm9EKuaIWA/XM= From: Krzysztof Kozlowski To: Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org Cc: Jani Nikula , Pierre-Louis Bossart , Krzysztof Kozlowski Subject: [PATCH] checkpatch: Look for Kconfig indentation errors Date: Thu, 28 Nov 2019 03:06:40 +0100 Message-Id: <1574906800-19901-1-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kconfig should be indented with one tab for first level and tab+2 spaces for second level. There are many mixups of this so add a checkpatch rule. Signed-off-by: Krzysztof Kozlowski --- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e41f4adcc1be..875e862cf076 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3046,6 +3046,13 @@ sub process { "Use of boolean is deprecated, please use bool instead.\n" . $herecurr); } +# Kconfig has special indentation + if ($realfile =~ /Kconfig/ && + ($rawline =~ /^\+ +\t* *[a-zA-Z-]/) || ($rawline =~ /^\+\t( | )[a-zA-Z-]/)) { + WARN("CONFIG_INDENTATION", + "Kconfig uses one tab indentation, optionally followed by two spaces.\n" . $herecurr); + } + if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { my $flag = $1; -- 2.7.4