From nobody Mon Jul 27 22:50:49 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E81C4195A8 for ; Thu, 9 Jul 2026 17:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618899; cv=none; b=fKSl92Vb5Dz4tzhBlUrt6ONhcUuk6H5s9rja0rogCe8CA2ukT1UPNPcUc0YK4jxusOOGUUDQKa+OHXvc2BOiZQq4r6C1FQM+EEgGum1gVEQyODGIPnsQZg39eEK89QoEQAqrWTZwoZQC5AaHbcMJA5u4f40gc6GtcDkBkTiNeXk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618899; c=relaxed/simple; bh=G2bXd/eL1oQYJ0l760V735gooPZRhUjHojCT2I+xTys=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nBLCEaL0SywvXls3bzsEcpy0PxIVw1cXocx8N0zE2oK5Z89X3noj1OuD+a2hJRBG7DKOMxMpAdcRckN8IbOuHx8x6wXvUXavrj5w75Mi2OsFtXWhRszah9u/28IcK0kdplS5A81L3Mr4thuND+kn1zJ7UOCaxHhV2FKoMN/ZBdo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=DA9NUgDS; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YHq0GwHb; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="DA9NUgDS"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YHq0GwHb" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669HYbWd2475979 for ; Thu, 9 Jul 2026 17:41:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Iz6MMBBcLVyXem2iMOZHffZZPDG2zluSgPsoX6bhY08=; b=DA9NUgDStP8HI8ZF AlTlVqeWQuktLz+vx4iJfPCatQreBCf75xz9qbtizStVO/oWZTz/w3OBJ6L6RYLT +oIEjaOWRTGv4kQmFe36wmVATrlu1Kj7FtmPlkWatwWoGARLbCSJd+KdQxJrFJ9e 8hepcXjrMEZROpg7lr4mZWztZDG2jKPIUfwHGoQusWkIB4/fms8nmGJmJHNc0VtG ErOEHK8txMxjfgcB5oUzUxsuhomcx2akUmBoyyMrRSMjge51ivvgB6At5dN7Igcb sX1q5WmtccU94McObeCrCzZPBtHmWSaBFw0CT8XYfNXyzMxGM0Z/IljxvJdaFb2h U/q0/Q== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4facqph8ek-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 17:41:36 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-51c1e6f602cso443051cf.3 for ; Thu, 09 Jul 2026 10:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783618896; x=1784223696; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Iz6MMBBcLVyXem2iMOZHffZZPDG2zluSgPsoX6bhY08=; b=YHq0GwHbQNmO7yOK2A9WPMFOz46NIgKueWvYokreJvTrrVXPiXzTtNQIZHqIm/jgO/ WizG/UiewVYGh+xPI/6OyBJsAlEapoE5bm2arzeVxvDN37yheTD2iJBBf7B0pZnBOVYH PtAT092vsEsdf7txzLNzd4EVS0jwtLRdaNNKVRk7MCewVXsUhnVvoWG0YfPbLIQWSddr GIh3pIBFemC3bwVhyW7OLv62wDxe1C8CV9+Q+aK8seZHAOE+UL+cN+zQoAnaBSslWsqU 0MWXNpTUGYafxwKDm2JVS+d7yllBTM/DFD1BGogAazN0K6l8p2OTSdEQIqpOjWoCKsJG 6U/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783618896; x=1784223696; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Iz6MMBBcLVyXem2iMOZHffZZPDG2zluSgPsoX6bhY08=; b=cRgRNvW+JOktayUNQJfad/nuL8+wpY67qsvats9Ycf+2GyhJSJyLL43wtSzOoZ7tqD 7puzmp8FtEkVeD5anJG9KDz0iUH9Z4esTaAkm+gkD0gnK78BzuMDtJrJP9sVvqUWCLWw HBxBuDXLlPR1G4zZKd/tp/1ZB6jETpi3vDFfCOupboTaR1ZQ4AMtbaJo/Idv/sgZ1TxU rN6UsRUfrUf2OOqlCzQ99tNmmr2YbnLGw4kttCcn58hjWigjDjaGNwWBLtQ+1CHmPwGY hEsjRzwOUxXkKA/WgHtQpcWVfFS9mMSgWxOY4IclfJCavklzYhQr5RSgyjZ1MvKggpu/ /Z0g== X-Forwarded-Encrypted: i=1; AHgh+Rqu1RYFTHiE7gcOsEEL20NQs9+ojoCH+urF9tzYz8AQ62T1FQmt+5/aa5xMhZXwx7q0lU/mhGmv0ROD6HQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yxe3b9rOrJ3B/FRcXdlLpa5ZzCE5EfBxpjhcEgEG4wEPlc9P/fK 0UgW0pMWu02iil/yAE09xjdEvhNektMFUqDmtoUj36qnut94OFSW7u87I0jR7ysLnvRS83aY86u Ewc3zH5W17K90AX6th4yrYr7oSiZGk7Yc2ykTd9+zO80fWMxsebqlcEMuuXbUyPJsqbyRsh0hYe M= X-Gm-Gg: AfdE7ckCEMuglCNatM/Py0oORX99WdbrJCdYlH5fsrR49Z0VaZW/RNOzJbnQIFfE8Bi xYS6BtZ+4OiypiKJX4GaGcciqaLpv8SjcIALLJJfLuKQfomcHx+aWwbg7taAe29HnMoM27P7GVn nsLulvPuTB9TiJTokGuGr0KWoJTAGZWs0Xo24DqGDqLcAUqETL/u+NEjLVSMCngOxKyvopfk7VW ry35W485nCnuOt8SbdRvDfOFktM8NbnZm6MATau9rMDV5bYmI27B3u3jKYmtrUW2FqCZTjRlcKZ aeiSjbofeYTLK/aGJEnyefn/iFECUbZgdjSuTNYutn6icrB0nQwA6gzvFsKdo+OlHcqDNlr5FTe ikrtNG5+yJeGBW+vTB42rHJsy4Oudnjhj X-Received: by 2002:a05:622a:1925:b0:51c:1291:911c with SMTP id d75a77b69052e-51c8b398cf4mr102047071cf.14.1783618895889; Thu, 09 Jul 2026 10:41:35 -0700 (PDT) X-Received: by 2002:a05:622a:1925:b0:51c:1291:911c with SMTP id d75a77b69052e-51c8b398cf4mr102046801cf.14.1783618895533; Thu, 09 Jul 2026 10:41:35 -0700 (PDT) Received: from [127.0.1.1] ([213.55.184.23]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039bcdasm55174048f8f.21.2026.07.09.10.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 10:41:34 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 09 Jul 2026 19:41:29 +0200 Subject: [PATCH v5 1/7] dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260709-dts-style-checker-v5-1-fcc147cb697d@oss.qualcomm.com> References: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> In-Reply-To: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> To: Rob Herring , Saravana Kannan , Krzysztof Kozlowski , Conor Dooley , Test User Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Golle , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX0ysdwfNrUKQB yuxeh1PMJ0Ng4q069IuW7dE9gvxovKmhkLNdFUG1ma3VukmccPCZz+Me4017R0ge8ocLXekP86s mL56wu+fdxt3MaEYgCBzDFZtWsXEaqVOwl6iKq6lOLOOfXCziCaT0/X+q0/KJdoE1VyK6rQHZt0 n5Z3PTrVm5ExnRDbXRv0/tjBv2SbV9xCBhXPAvT0rQemW49x/LGjp25p4tRDZw9Ij686VpF1nk3 lze6FSbCvao3okg1GSvPTRcyq2lWfeA518wK21LelNVbu995nz9PJfOrdZJtWmNkn1pGV6TUMBY ZQM4hE2/3Pdx+f69x9yBZWmTi+YDWlfXdF8NgF3egldopr52fRjn6DU6gb+BU/or3dOBDMGH+yN 1WGjhwIF5UHWBQwgjsigKQRvJoolcISbOnmbQ3MGyP6aENUbxJcpWfiGzNtKpy+GOumKdKTa6M0 bhNYA4VsyKJIbz3REaQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfXynUzkDVJZhR6 F972AOlEQSh0vkXzfapMb2Hht/Q+TkDHW0KIyaNMkhP7Pqb5qDSYAckX/JvQafSL9Xh38LOdT8w rX+esusIdTcw8AQLM4M94VLNOHcZUAc= X-Proofpoint-GUID: fqxY-kBEX0bc_MVoYDk0tI2q9U3dj2Qk X-Proofpoint-ORIG-GUID: fqxY-kBEX0bc_MVoYDk0tI2q9U3dj2Qk X-Authority-Analysis: v=2.4 cv=GJ441ONK c=1 sm=1 tr=0 ts=6a4fdd50 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=nvVmADDuAioZMzk/ZEnfEw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=V5pUajA8bHdET0NC2RYA:9 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090174 DTS in the bindings (example in a YAML file) does not have tabs at all, but regular DTS do, therefore entire check check_tab_in_dts() has confusing name and should apply only to YAML files. Signed-off-by: Krzysztof Kozlowski --- Changes in v2: 1. New patch --- scripts/dtc/dt-check-style | 8 ++++= ---- scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt | 2 +- scripts/dtc/dt-style-selftest/expected/yaml-tab.yaml.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 2d5723d41ea3..29b25ecf15c6 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -340,7 +340,7 @@ def check_trailing_whitespace(ctx): yield (dl.lineno, 'trailing whitespace') =20 =20 -def check_tab_in_dts(ctx): +def check_tab_in_yaml_example(ctx): """Reject literal tabs in DTS lines when input is YAML. =20 For YAML examples, indent and content must use spaces. Tabs inside @@ -927,9 +927,9 @@ RULES =3D [ Rule('trailing-whitespace', 'relaxed', 'no trailing whitespace on any line', check_trailing_whitespace), - Rule('tab-in-dts', 'relaxed', - 'YAML examples may not contain tab characters', - check_tab_in_dts, applies_to=3D('yaml',)), + Rule('tab-in-yaml', 'relaxed', + 'YAML (also DTS examples) may not contain tab characters', + check_tab_in_yaml_example, applies_to=3D('yaml',)), Rule('mixed-indent-chars', 'relaxed', 'indent must not mix tabs and spaces', check_mixed_indent_chars), diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.= txt b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt index c989f8f19853..4b3d990e0824 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt @@ -1,3 +1,3 @@ # mode=3Drelaxed bad/yaml-mixed-indent.yaml:27: example 0 [mixed-indent-chars] mixed tabs a= nd spaces in indent -bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-dts] tab character not al= lowed in DTS example +bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-yaml] tab character not a= llowed in DTS example diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-tab.yaml.txt b/scr= ipts/dtc/dt-style-selftest/expected/yaml-tab.yaml.txt index 9e83246fbaa1..0bc67ae48dd8 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-tab.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-tab.yaml.txt @@ -1,2 +1,2 @@ # mode=3Drelaxed -bad/yaml-tab.yaml:28: example 0 [tab-in-dts] tab character not allowed in = DTS example +bad/yaml-tab.yaml:28: example 0 [tab-in-yaml] tab character not allowed in= DTS example --=20 2.53.0 From nobody Mon Jul 27 22:50:49 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D53064195B0 for ; Thu, 9 Jul 2026 17:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618901; cv=none; b=DR9Be3Epv7J862V/fcv654mbwGYcnKKjdj14az4Z80B3JQixGA1CNpxoAqNifZsGQrpQd7vQE+iElQiCOkgFgiQVc6IfqatehGhWHLMGBcZvmNjrxEoex9M1iSnOkGX2ysLEhOjP9FTjtr8W7HCWP4u9Xltw4Z7OoE16e/duNjU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618901; c=relaxed/simple; bh=hhxMLRyhmmqO/lCJtwd/K1/4O0l/CMASeXGHtr++M8Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dZ+OiFR+/g5mnLsxDBN6wryzx5bxfr1ZCYVMcfKa08xjaHRcazs46+tBrZUADy9mc93rZEM/hJ9qBQyHnoJEafi9NJQWtGbKUULKXUJ0UBCE0/LA5o9HBz5ySf3GKWK0cKs/BMTEqQuGl2Lf/sRrfnOx2lLVW/T/ZUV2Q4V3OgQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=M3AcWhit; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Im+zr5lS; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="M3AcWhit"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Im+zr5lS" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669HX3M82295179 for ; Thu, 9 Jul 2026 17:41:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= AXRIodgQnBSxIff+yZejwe0OLdZZ0AUG1z0Dy8MKJzA=; b=M3AcWhit+bNcGIaN +oTBk5lIWG3GferCh7Vum6UZhmszk4HIDIhrptg6tFUXX9zxnedNi5sbI8rZeT4v +UT3J6+MlUZkcKUoFEYsF/+mr9Nx8pqGu983JKKzTTHNFN2eBDDd3fcadpP5Ngcj a2vcFjOoHE+DNqYmBZpqWvkW3XeOKbK6Dvgj026aLKRgezbogkOzLpZZ/V2Uc+uU MM2YVS4zksqk04351bJcROe+UtLKF8r3z2SbDFuaHFmFjpsU7RtXjK05Jknpthzk SefrkEvikgxPSuiZNw24mlQVQHtgSWY4XX8170fsw5BYXcP+ZTGGHgm1ktx13Hil o072TQ== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fa55vkf75-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 17:41:38 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-51c26012cd0so340991cf.0 for ; Thu, 09 Jul 2026 10:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783618898; x=1784223698; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=AXRIodgQnBSxIff+yZejwe0OLdZZ0AUG1z0Dy8MKJzA=; b=Im+zr5lSdwgh3MoYbkua5d7Z4cIq8z/eKoxHB7dwHd/PtknKDVz6AX9SPXDP65gUO4 voIls0U1iWhWt3jeANRbMpdqJDgVWQbp6XHaJo6Pp9aWM831vWNcrkxqCgraql5ICjW9 MQIJiD2+gJpcVrVpJqWHyHxxJ5FkCIhOldfepFuMS1mdgs3MmSI0PR0Aol4KE+8NwZiC dh+qcw7e25GuNRiEPBscsdM+wenfJQH8HZVLI7XFEc3mV7yjMZ2NkIQHTlITKekeZXn/ 181CnBSp7h4CJT50+NcfC0fhh2DSkBrzhQD3Ym2fbGaeQkD2VHknRqvYHns6eDLACohj yogw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783618898; x=1784223698; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=AXRIodgQnBSxIff+yZejwe0OLdZZ0AUG1z0Dy8MKJzA=; b=Yju1krqAUJLyKumdUvcV5G0NZ2ilLvlVMAoA8GgfSibCEAGxcIbg2QwSlww0aH6f2Y ufw9nkWz1WfE2Yk5eTURbl+2WPwVlwvH0sb+B0gI1HC3oMZJSkqFIG4ER1CLIFu7UF4M WeEbmC1KV7xQmiKkzVfHWNM57ONZ5AXGuZXVzujUgJbqc3HEqqnCJd4tTAgCUaSChACN zx84BSmnvWgblhgNNNOA5yhKE7XPHat8mn7tpz+THNrlAvBXSb/zNv18cfQ1w/0bvoCm 7nKUeR6tUxAtTcyulDZk+aI+TDaiHGq90ZadBMZakklYDkYh6JfHAY9liEfrWZlDKQWO e0JA== X-Forwarded-Encrypted: i=1; AHgh+RqoL+er6mQddWAR/aCkettsA/6lQWU2LuVrUuKlakhj3YXYpriMZoQ0uiWWavWjn0ARaDj9ITn6bKucLTc=@vger.kernel.org X-Gm-Message-State: AOJu0YzwGPAfKLEUSlBezdNTAwd9iQKfT9amcf9MoMhDZlsVk1Z9UWPW iRIFPxLwoOjKkKYNR9ypbrbX7sOfQjLFHgH1ptk8tQj4LfT+kMBGdB2oELbSs5ey4F//sJaRwTm a+15pzd7dJk+6q1N47nZkufzyJBuxobcchy7gXwbrhur/ULqSvS1J11dx5Hdp2DhwoWs= X-Gm-Gg: AfdE7cmRqM64iV/cpV0jB9k/wKrgZpC7KG0sQTgE7Yu5PTHLyNXeSY1+rH8taDaNPTU rylSSJ8XYqPwgHDKB0BY08i/EHGs0H6kwi+qmkaFzOlO9JwR2ceViAPEKPjvg28ntZAe+i1c3np cOe3JaxfW7q824uBQYqgH1PfXHiNSrYEtaZfw349rUeL7mnaWn7lq7D0YhyJxsFXXK5kcCfU4w0 mVdK3l9qEOBrh4q+P6kVZRJNh+CtHhsKYVjolCD0V9hHEfpyl4VrwlgyYva50y9kLNpYWu+fBmX BuFs5B3Umy3BJ9Sey4t9I8IHRauDOfjnpLoEo2lt2h1zgvRX/63ZVNzZP84o6XRtYV9oPoriSXV hULSmZ4P4SssjAcmdIQlM4WbJE+Ew2pdo X-Received: by 2002:a05:622a:1647:b0:51c:ebd:fb42 with SMTP id d75a77b69052e-51c8b5659abmr85758681cf.59.1783618897929; Thu, 09 Jul 2026 10:41:37 -0700 (PDT) X-Received: by 2002:a05:622a:1647:b0:51c:ebd:fb42 with SMTP id d75a77b69052e-51c8b5659abmr85758201cf.59.1783618897408; Thu, 09 Jul 2026 10:41:37 -0700 (PDT) Received: from [127.0.1.1] ([213.55.184.23]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039bcdasm55174048f8f.21.2026.07.09.10.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 10:41:36 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 09 Jul 2026 19:41:30 +0200 Subject: [PATCH v5 2/7] dtc: dt-check-style: Allow space-aligning indentation in DTS Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260709-dts-style-checker-v5-2-fcc147cb697d@oss.qualcomm.com> References: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> In-Reply-To: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> To: Rob Herring , Saravana Kannan , Krzysztof Kozlowski , Conor Dooley , Test User Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Golle , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX/HyF0HPr3JKz 6/cFxilaPRVaj6Xqr7HKzLq7/o+scu4YM3zuupZ54yGR41+JLrqvUEYV4WMtVbTDuJ1tOO7PY0f cdUDz8cPkIRQ+klTziuMK8jZHxdQq2Mzu19LYT87TgGeTpXlpjoUHH0Kcv6NXe8Ypw0wmFy8zCD g67UJYzKR9DwHXBJdiUgc9YT+jVHw+9GXswNdYPJuhVoMfC+IqSBTxaXRSJXRvxeuRp6eM8aAlK 322vrPt+WKn/ZqB100anMBWpKl4z8p3CwgMZXNNquuIcKyLf4W+hlD4ky6V+2inRSM7/HDjxYOv WY40k+kLVOurPsNiNRykkJRKaq7TA8qWxAKJYlDJ0Mdt0OaxBmxRY+2xUfm3U5K9LaIGLKzK/Zu a4QyVzfOkv2ktZIDgIcyCFTezWOBolLSmWsFFy0+c4Lxfnq3LhxF04Pph/nufvdX/y8iUcHcYYf 8ch1oXfPnOC20aikmOQ== X-Authority-Analysis: v=2.4 cv=KfDidwYD c=1 sm=1 tr=0 ts=6a4fdd53 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=nvVmADDuAioZMzk/ZEnfEw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=ay0YNoD6mRcLqaeziEEA:9 a=QEXdDO2ut3YA:10 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX9rKJnySnuxwQ X25l67IMxaK5u9vt+VDYxoXc3ttAkNoTFhVrpajn9+gPHIHuSvncojVI2avZYkpntKI0KJw79DL cVCeNdlwnMSHZJsc6ax9ZUJfJccju5Q= X-Proofpoint-ORIG-GUID: 3SPAg0BYB3Gu8dFhXV_xAIXVDL5AOiSE X-Proofpoint-GUID: 3SPAg0BYB3Gu8dFhXV_xAIXVDL5AOiSE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 adultscore=0 clxscore=1015 priorityscore=1501 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090174 DTS often have spaces after tabs in indentation for aligning continued lines of comments or list properties, thus allow such cases to avoid many false positives. What we can easily detect is a space followed by tab or too many spaces (more than alignment). OTOH, DTS example in YAML files does not have tabs at all and there is already rule for that, thus there is no point to check for mixed indentation there. Signed-off-by: Krzysztof Kozlowski --- Changes in v3: 1. Use re.search 2. Add dts-mixed-indent.dts test case v2: https://lore.kernel.org/r/20260706102421.343639-4-krzysztof.kozlowski@o= ss.qualcomm.com/ Changes in v2: 1. Rework idea. 2. Adjust function doc/comment. v1: https://lore.kernel.org/r/20260706071446.87669-2-krzysztof.kozlowski@os= s.qualcomm.com/ --- scripts/dtc/dt-check-style | 16 +++++++++++++--- .../dtc/dt-style-selftest/bad/dts-mixed-indent.dts | 21 +++++++++++++++++= ++++ .../expected/dts-mixed-indent.dts.txt | 9 +++++++++ .../expected/yaml-mixed-indent.yaml.txt | 1 - 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 29b25ecf15c6..e715fb1e741c 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -359,14 +359,24 @@ def check_tab_in_yaml_example(ctx): =20 =20 def check_mixed_indent_chars(ctx): - """Indent must be all-spaces or all-tabs, never mixed on one line.""" + """Indent must be all-tabs, except for aligning indentation (comments + or continued lines).""" for dl in ctx.lines: if not dl.indent_str: continue if dl.linetype =3D=3D LineType.PREPROCESSOR: continue - if ' ' in dl.indent_str and '\t' in dl.indent_str: + if re.search(r' \t', dl.indent_str): yield (dl.lineno, 'mixed tabs and spaces in indent') + if dl.indent_str.count(' ') > 7: + yield (dl.lineno, 'too many space characters in indent (more t= han 7)') + for cont in dl.continuations: + if not cont.indent_str: + continue + if cont.linetype =3D=3D LineType.PREPROCESSOR: + continue + if re.search(r' \t', cont.indent_str): + yield (cont.lineno, 'mixed tabs and spaces in indent') =20 =20 def detect_indent_unit(ctx): @@ -932,7 +942,7 @@ RULES =3D [ check_tab_in_yaml_example, applies_to=3D('yaml',)), Rule('mixed-indent-chars', 'relaxed', 'indent must not mix tabs and spaces', - check_mixed_indent_chars), + check_mixed_indent_chars, applies_to=3D('dts', 'dtsi', 'dtso')), Rule('unclosed-block-comment', 'relaxed', 'every /* block comment must close with */', check_unclosed_block_comment), diff --git a/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts b/scrip= ts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts new file mode 100644 index 000000000000..cd3de04ec5a9 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* Test fixture: a .dts using wrong indent. */ + +/dts-v1/; + +/ { + compatible =3D "example,test-board"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + soc@0 { + compatible =3D "simple-bus"; + ranges =3D <0 0 0 0xc0000000>; + + clocks =3D <1>, + <2>, + <3>, + <4>; + resets =3D <5>; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.tx= t b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt new file mode 100644 index 000000000000..93146cfb51c7 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt @@ -0,0 +1,9 @@ +# mode=3Dstrict +bad/dts-mixed-indent.dts:11: [indent-consistent] indent mismatch (expected= depth 1 * '\t') +bad/dts-mixed-indent.dts:11: [mixed-indent-chars] too many space character= s in indent (more than 7) +bad/dts-mixed-indent.dts:12: [indent-consistent] indent mismatch (expected= depth 2 * '\t') +bad/dts-mixed-indent.dts:12: [mixed-indent-chars] mixed tabs and spaces in= indent +bad/dts-mixed-indent.dts:13: [indent-consistent] indent mismatch (expected= depth 2 * '\t') +bad/dts-mixed-indent.dts:13: [mixed-indent-chars] mixed tabs and spaces in= indent +bad/dts-mixed-indent.dts:16: [mixed-indent-chars] mixed tabs and spaces in= indent +bad/dts-mixed-indent.dts:19: [indent-consistent] indent mismatch (expected= depth 2 * '\t') diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.= txt b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt index 4b3d990e0824..bc3fc3cf00cc 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt @@ -1,3 +1,2 @@ # mode=3Drelaxed -bad/yaml-mixed-indent.yaml:27: example 0 [mixed-indent-chars] mixed tabs a= nd spaces in indent bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-yaml] tab character not a= llowed in DTS example --=20 2.53.0 From nobody Mon Jul 27 22:50:49 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B93484195BD for ; Thu, 9 Jul 2026 17:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618905; cv=none; b=fNixxjqgB2MntrgrwAqGEvL7wTe9cv1YS7Ia7h2yQhF1kshCU7/ka9QA00ILlSX+ixv39z9L83JObmCbom6tyJd590KWnhD1u/wri6WLLiqgtz3TFQL3UvPkcvoM1HtZCa1aW0EgfxsMauShUsNKo90mUq1Cr9eQeRYtWdUvPTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618905; c=relaxed/simple; bh=cPk+k52cx3zcERls/C08uAkqlJGszZ6Gi56F7QHtvuo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NyLvtXiLPY1NF4moyDqCNCmcwD92SxCDhXEE5kIsLZGxljW6MfMaChSqXVw54GQUHi08B6chCc4e8NSZEBAXOnKlni0+KgpwWdHctmrGGRYGTO6cbPoHCyJ2KrLb2ZUIwikx8tztoR0tz9ibT7SDe1zrzyCa1Xnq453yVkY6n+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=dXbd3P4F; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Zp3YX01z; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="dXbd3P4F"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Zp3YX01z" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669HWtlU2502330 for ; Thu, 9 Jul 2026 17:41:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 9UroyY47lYCvFUoUH/t3BnF4GTok3nQAcb0cM2LhvS8=; b=dXbd3P4FIUDjAkQr jukwOPzE4dbBlb7tvvwKt4QzlbHPLreKL8s1TVlu7u/IWgyuc6YzdS+9ED0okz+K aa6A3itg19UWyaL/xTfB62gvAgHt0VY9L1pBGCyndsjhZJ5+7z4lzJryu1jt+PXM /wpQi3ntSZuUMimwuAYWgbnSWOh6Z/oJtTh6r2JnKCcXK/7+gn/7Wt45OvlEZ/9+ lLoXU8ltpQnv4zBLXPjSju4aPOGr9QsJrvj8ZalQ9wNaNoyYw7WW0Yn5nbGcPgCE /dL9y+im+whHvcQ0z14+PDhZN1RSRZPECuDxNzX3yByLRxhevUW6Kekup1SGsQYG rokerg== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fa6p3u3qh-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 17:41:40 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-51c0ab07320so351901cf.2 for ; Thu, 09 Jul 2026 10:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783618900; x=1784223700; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9UroyY47lYCvFUoUH/t3BnF4GTok3nQAcb0cM2LhvS8=; b=Zp3YX01zy6LZ0CAQzGIhAbwdc/gV5JsfEj0eT9ACOvyRWJ8u/oJLLfKGo4/DO/NAHN wY7xKlVoawXheoeySBHMwA+kKWFIN2HdRTEhCFNHZ2MfxCF0mngxFo+zV/GUNRtfAMfM aJzJRhSOezyXzZ0CgsVEI+4Ns5t+r5q/xmod4hngDp2jcmPiKzqK+Pz15a4Q0k2/AAr/ LqyrdRnWPs2YW9r3DQO9NGod3DN2PqYahVUcahvmUOIL8W/E5lXWbm+G2ZN/yKHRe01+ S+qHEN5RlEXOUI9s4Okqi4pGt/HkG07eq+GvNeAKtm2JeAnR0kXeG5I+CKYsnDTJOs+B +QYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783618900; x=1784223700; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9UroyY47lYCvFUoUH/t3BnF4GTok3nQAcb0cM2LhvS8=; b=b9kOCWPKMW0GZj6wQxQDJ8iaIms0TexooTVubnWpjSBUW3cH2qn2yjvyfTtuuafNEh dW/wtrIW/3ecTPZPCJ6xdQeMAf+omWbeSoJyaFKbuQmgu/yfYk7HtqLA5OPyb9QAAPsO JmZgbHdON3ukW68IJExy+s+w+LFKf8RSw6kAVk8PwV+B+8ddI/oYWPmczIxsAN9MEo4y VhFkMoJbrNXBbDKTznXM1zshn6KSWgelzxvyEjJUH+7KEbuZlVQSkuRUDNuzeWlPPJYt wSOGxU4RmnzmOOp1fPQzRzYFpTubwBq1qo81NuYc4o11KnX3LXpGlnuy+aH3jGl7fu37 JuRQ== X-Forwarded-Encrypted: i=1; AHgh+RrE4t3YYeClNBGjn9TwxWC7YN8cBFr0jaAC2vM9E48mTnNQpIMEiMIY/OmHzGkX/Sje39a/T0T4ZGO7jKA=@vger.kernel.org X-Gm-Message-State: AOJu0Yxf1GhAwQ+yU1rsj6uHAk7yMB63xHLN0Y/vuW2N48OYTQIs5bHG xp/KySFBbRi7Es+YnJ3MuUeWuLOaEaaErG5SUst9uyIzjeDdYv6JLHmJhgFOMWH/2fgCI37JvGE PSOF7Lwa8iExuHLrn5MHTSvHI/zSC9aUk+dwMWwjIX1cqJKS+C49PX+YmP4E0XSoB+88= X-Gm-Gg: AfdE7cmwPBSMTb8Qf9y1jVRLoxcouGlZqidbOx8v++qZig4S+tWxJw1GvgjZVHJDAGS iIONExeZdkoFXEVdh0F1gs+g56gKL9FDMUxP18cRftWmsfFSiVBZusRHiXJBR7KQBWgTdHG8KKW FiNeRI5lgRge1inq01ZWZWkgaUFoc2B/UTP8d/Bpf/v8uOYhFbHlL5ZQvGXwXH/qiiUVPGlaVwb CZF6JUq2am5FVEsFDVe26nkbTsfwL+KIBpFcKPy/MPGik+APY1CgxNQhjqhechFy5aePLXNMrym mi9YzVrlinv9ei1q/gOpX+xepnqN7FnCMC/fuIDpDWAi6gCpqK7TksCs0v4R/7rt5DAMMJzzQCD QLok6UFBFD8ezR2poMgyAR5sCT81xYyCz X-Received: by 2002:a05:622a:2282:b0:51c:4eb:b586 with SMTP id d75a77b69052e-51c8b2bcca6mr90520901cf.3.1783618899799; Thu, 09 Jul 2026 10:41:39 -0700 (PDT) X-Received: by 2002:a05:622a:2282:b0:51c:4eb:b586 with SMTP id d75a77b69052e-51c8b2bcca6mr90520641cf.3.1783618899413; Thu, 09 Jul 2026 10:41:39 -0700 (PDT) Received: from [127.0.1.1] ([213.55.184.23]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039bcdasm55174048f8f.21.2026.07.09.10.41.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 10:41:38 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 09 Jul 2026 19:41:31 +0200 Subject: [PATCH v5 3/7] dtc: dt-check-style: Rework handling YAML/DTS in rules Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260709-dts-style-checker-v5-3-fcc147cb697d@oss.qualcomm.com> References: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> In-Reply-To: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> To: Rob Herring , Saravana Kannan , Krzysztof Kozlowski , Conor Dooley , Test User Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Golle , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: BNJoaStI2AvOjI6-HUpcAbdzth4yMoLm X-Proofpoint-GUID: BNJoaStI2AvOjI6-HUpcAbdzth4yMoLm X-Authority-Analysis: v=2.4 cv=TPh1jVla c=1 sm=1 tr=0 ts=6a4fdd55 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=nvVmADDuAioZMzk/ZEnfEw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=ZK4BJI6VOU2p3dBXLA4A:9 a=QEXdDO2ut3YA:10 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX8/Ot5ETG1lA2 3Y2jqgw8YehGVLqlSchulQeU4RfO/SROp4A9sREWBypduEc5OLIFM8JoQhRpmgZPKhqHgRpq3RT hmGJQcN0I1VseiIVzYLADQeYZjq3TNk= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfXxWAVuyJFqVmz 2oBluMJj94+4WRTz0TfWYRf9X94iAQss59nKaYNQACtp+hfF1rN1NtE2iCxClZGa0tntC+4UYSs S/1pHqfv+hVuMdmgRig6dyQHwhO14EzcTGYtj1U5t4l0Lr4ymuz2fnjzXeif81uEYY4yEuBr8VW I+0ur10QQp7QIK/GMWR+zFSOH1bsAjfvoMeHPj5jovrODKteHwfRHQIBWRaDJN/Ty885pg5X0yt WAJdGQNR5J0WthCBht5Ucd/akD30i7vPnq1u/mLa2VF8ShJ/4CyZB/X868GO7VFTLwYvMF4yu3W /nr2ZqQ7nAbT1bSf9RJciPvlYvlkcHvK405I7iv/CHNeWYRCn5N9Eoy53C1SoHG5/y1xyM3CUWs mIN0WizqPyyYkL2XwSXcGnqhXetxuk/kQ0m5EEF/9OhTY+NCrURLzv4K4q4u6jgyQ+8tLeNIX/1 S+LgR6wdEutccQ3tTlQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090174 Individual rules behave differently depending whether they handle bindings (YAML) or DTS, but the code was focusing on type of indentation (spaces vs tabs). That indentation is actually irrelevant in some rules, so differentiate based on file type. This will be more relevant in the future when more rules act differently on DTS, than on bindings. Signed-off-by: Krzysztof Kozlowski --- Changes in v3: New patch --- scripts/dtc/dt-check-style | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index e715fb1e741c..f5276b5fdd46 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -311,13 +311,16 @@ def collect_labels_and_refs(text): =20 class Ctx: """Context passed to each rule check. Carries the parsed lines, - raw text, mode, and indent kind.""" + raw text, mode and kind.""" =20 - def __init__(self, lines, text, mode, indent_kind): + def __init__(self, lines, text, mode, kind): self.lines =3D lines self.text =3D text self.mode =3D mode # 'relaxed' or 'strict' - self.indent_kind =3D indent_kind # 'spaces' or 'tab' + if kind in DTS_FAMILY: + self.file_type =3D 'dts' + else: + self.file_type =3D 'yaml' =20 =20 class Rule: @@ -347,7 +350,7 @@ def check_tab_in_yaml_example(ctx): a #define value are tolerated (those are CPP macros, not DTS). For .dts files, this rule does not apply -- tabs are required. """ - if ctx.indent_kind !=3D 'spaces': + if ctx.file_type !=3D 'yaml': return for dl in ctx.lines: if dl.linetype =3D=3D LineType.PREPROCESSOR: @@ -427,7 +430,7 @@ def check_indent_unit_strict(ctx): unit =3D detect_indent_unit(ctx) if unit is None: return - if ctx.indent_kind =3D=3D 'spaces': + if ctx.file_type =3D=3D 'yaml': if unit !=3D ' ': yield (1, 'indent unit must be 4 spaces in strict mode, ' 'got %r' % unit) @@ -438,7 +441,7 @@ def check_indent_consistent(ctx): unit =3D detect_indent_unit(ctx) if unit is None: return - if ctx.indent_kind =3D=3D 'spaces': + if ctx.file_type =3D=3D 'yaml': if unit not in (' ', ' '): return # let check_indent_unit_* report this else: @@ -1023,11 +1026,11 @@ def select_rules(mode, input_kind): # Block runner # ------------------------------------------------------------------------= --- =20 -def check_block(text, mode, indent_kind, input_type): +def check_block(text, mode, input_type): """Run all selected rules on a single block of DTS text. Returns a list of (lineno, rule_name, message) tuples.""" lines =3D classify_lines(text) - ctx =3D Ctx(lines, text, mode, indent_kind) + ctx =3D Ctx(lines, text, mode, input_type) rules =3D select_rules(mode, input_type) findings =3D [] for r in rules: @@ -1107,17 +1110,15 @@ def collect_findings(filepath, mode): formatted output strings; count is the number of findings.""" kind =3D input_kind(filepath) if kind =3D=3D 'yaml': - indent_kind =3D 'spaces' iterator =3D iter_yaml_examples(filepath) elif kind in DTS_FAMILY: - indent_kind =3D 'tab' iterator =3D iter_dts_file(filepath) else: return (['%s: unknown file type, skipping' % filepath], 0) =20 out =3D [] for text, base, idx in iterator: - for lineno, rule, msg in check_block(text, mode, indent_kind, kind= ): + for lineno, rule, msg in check_block(text, mode, kind): abs_line =3D base + lineno - 1 ex_tag =3D '' if idx is None else ' example %d' % idx out.append('%s:%d:%s [%s] %s' % --=20 2.53.0 From nobody Mon Jul 27 22:50:49 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7C504195B1 for ; Thu, 9 Jul 2026 17:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618905; cv=none; b=nu7Kym35ZqJwAQYIVAwEApI73ZWXmAjCqko2yjg8CnK4JnBjLhWyJPhzdJnqZyp2DkZ2UMhEETDy1J9eULQXFCxBaKRhwooBH+p93aTZf90jwz2WDlArauh3teFPh8iNXGi89dzdbM3j1AUHrtmWfbpZSDadkEKAgLbvmjkp/B8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618905; c=relaxed/simple; bh=0uDbwMAVvTZVeF4og+Wu8eubaQ3DdGiQkZQqjF/ekDw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KRefeFrSJUMo5oZzyxmFvQ6Mtiz9kJNfyH0v2oajkIoCsFoGnqJKgwvrSXAkDip0B2qKgUY0OZWtCzMwlYkr+eHtmQ36ls0GljplIRlYFFKNVnbIh0ZLJRuCGsT/qJHt2YnkrJtVrh9DDYHEULe2Be0Uth0yt0PeoAic+1XHxgs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=KufXyDhh; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bOwEq6pH; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="KufXyDhh"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bOwEq6pH" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669HX3mQ2295172 for ; Thu, 9 Jul 2026 17:41:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JEWFIY3gmKz/g++62zXk4CVgUhXh1goNaOWhffCyCes=; b=KufXyDhhCstXb3gu wbgDGjwPXG+NKTa5NFzh7y3oMgiX1jkEN3v9pH0S8OLArz+0tQ/uTC4o8zkb4g0U o7QvseuYefldk1/MXVPlUkvvBK7PrYcavL+0MQAtQwyoK20ZXoNOdEpqcG6cYZhY r75Pk3IGUHzX9MDWw8VmXVgD5URRUeosXi9gwY+hs3h8Yc0LWOm/Ki37pR0JfE3z bP4q8+Ut+qwL6Gno5xtnVpGmJt07RzdYh9LG865flWjS6BVvgrve3vO7/xt95svk rU9GrPw/nYEkiulQqkh442PY/dK2jT4awzra59CxUnKFQnixbxbi56GaV0bO1Kz0 tQXRaA== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fa55vkf7f-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 17:41:42 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51a8b0a08d2so443201cf.0 for ; Thu, 09 Jul 2026 10:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783618902; x=1784223702; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=JEWFIY3gmKz/g++62zXk4CVgUhXh1goNaOWhffCyCes=; b=bOwEq6pHM8SW6Ncwmwd3M8/6/0ICP20GGSeEF3n/8j+mII355uwblPLxXoGGR5z+IP zEzq+IFAtxMVWNvYD63Jyi3kwIb513zslxwmPqYUX4T9Yvd6m6hMwupv+VVQGmLJ+t2N CwU4OK94JwKijv/3f1c/B5ilPPz65gelZ/hG3KUBxZaaTDDuPpBmCvu2dstckUkHdkpf D/RBbiimKcYdv3/bc3+hI/Reohk/UtVroyjq5lPI0geAdKJGSDjhp1Mjbx0r1EHb254X hVNw59ePBVVVJkv7lmU9gmfWHqmG2E7Xkz/v7ctKwEKBMX3x8+Wdf3TwXDIU6ERSgzin u8gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783618902; x=1784223702; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=JEWFIY3gmKz/g++62zXk4CVgUhXh1goNaOWhffCyCes=; b=tEE4YGVCxO/OFM2JGUiTb8QIH62anM++7X3p3RcE+s0/Lf4SKUSo/3shQW6DBZZ5Hi 4V//gESM9LMlLJuqh1rXxIK1axMfFIMAk6WJd6oRN/PufdWXNQ5C8YUdsH49beKEvW1P fcUKdfjgsL7uBkTLvHNIP6ClDloUIu2vwm+LZRrRfzW9GwuSKQgRwLCTVL8s3yfHFm3J CfqarT8sczwA3ZsWgy33/u1sDAsk+7nfcE3ig0XBl+h8hgDu9V6G7ziAGvie5QJu2bBS hCGhE7x5iXyO3uh9V7au4ETEupkwqfLTBoihAmaye7ka2hiI+KbTZz2MVi5eJIDj10+D OjAQ== X-Forwarded-Encrypted: i=1; AHgh+RrXU0SjZqAaCIVrYw/hHWBRe6RR6mRRTWl+a7+iefwN2hyV15i0GqfWRMTjzdVJ10Rq9u2tZFYoUuGJXiw=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3AOHKio0HItQOhtsI8r+aOyATmr5upV1wZfJxQSGd9xKQjor3 YDA9qls2gupgCZ//+Leg1/SzbXEelS853+R+Z6U/M1nqpuhszKc/dpARo1MIRANRxfdgP5HQ/R7 DB6EDo5+TE55y+w6cRPxq+njQCLwa69WU1Z6N743nygzCTbyNkjPkF2cHfYZ7hW9bThw= X-Gm-Gg: AfdE7ck9I28G3rEsbCN0WY/8dAwAKq681Rzxpci2T6ECy1PiPNjNRsF4SQYGL+ZupeA PiXkE7JJ7h3EDRrlKD3dOVZayV/aIBiczNTN3E4MvuzujwfEB410PeInBng+M55ozTrHDK5mSxj WjBn5+5SkoHKjHWbZqQXyEMin1egj9KtCTneveIw+Mn5Xp4/rlLCvAcbyI0OoHWw4vohrB6kJ+/ e8bkhKjhOWTsPaKXaD8uF903FyF5nythebI0l7aU3GGqrH4VhJvPHL3z7cvNJ7+aX4DAsKdZdyH 3N1ix43EzyH8be1UG1O9wlH8RIUk9f/dNhhXlk5Ou/3cLG8gsLCgIwssobB0f7bUaZxXRBswbEy 64wZcdfENq9O582w4BXqE9eNPJUAP4rx5 X-Received: by 2002:a05:622a:1824:b0:517:78c7:d93a with SMTP id d75a77b69052e-51c8b2ae64cmr89107611cf.16.1783618901717; Thu, 09 Jul 2026 10:41:41 -0700 (PDT) X-Received: by 2002:a05:622a:1824:b0:517:78c7:d93a with SMTP id d75a77b69052e-51c8b2ae64cmr89107221cf.16.1783618901248; Thu, 09 Jul 2026 10:41:41 -0700 (PDT) Received: from [127.0.1.1] ([213.55.184.23]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039bcdasm55174048f8f.21.2026.07.09.10.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 10:41:40 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 09 Jul 2026 19:41:32 +0200 Subject: [PATCH v5 4/7] dtc: dt-check-style: Expect first device_type Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260709-dts-style-checker-v5-4-fcc147cb697d@oss.qualcomm.com> References: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> In-Reply-To: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> To: Rob Herring , Saravana Kannan , Krzysztof Kozlowski , Conor Dooley , Test User Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Golle , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX8O5oTv2xO9Hc 0totDMCx3j2LClAaOA3Eu/8XNVe5hjoONIhZi9UE3jGsiFSyBMrKfLW0BUjGb80R4y7QOAVRMoU Ua2/vyTeMn01gLrJQ/9uu1OVhxqbE0XwDXpxMbyA7QX0s/LTbu+oH1SYF/HS8KINo0BFk0Gp4RX 0kICH1hj6OLLuZF7Oq3KosPlaVZywIM54InGqpfRp7P1DAJzK13TkzRCAIULPKOGod6IrA3ECVY Sw44KgaqCOxgm31HGo3SPEWiTT88PAazmwbY5E/Iu6BvKURmdF5cnDh9Zcemh8CC0jNNmA1NmW0 G7jAxjkka4DIufgmUh0lpMcmWvb5YY4BRyeHTIgRwsDjBF96e8rQsLEfxKTcizon7G+sAXdLu9J nZmOqQpy/krhCOPKEP86EkMCFuccrBQzQRUJZoJkCGD2hn3DIhkdD4lopCHa75Na5xX/YBvMVNZ bftQJ/mRTDy++JiJueQ== X-Authority-Analysis: v=2.4 cv=KfDidwYD c=1 sm=1 tr=0 ts=6a4fdd56 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=nvVmADDuAioZMzk/ZEnfEw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=A1X0JdhQAAAA:8 a=48zBhpcJxELL0NsAqQkA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX784QS32goP9i /vV3f2Re71o65SRoenmviURKH9IohGX938mak0v3f0cIa5bn3vpgaDW4472bth+8623DOkZs7lu H21LIaULlxJR/inYwelurkjbN+Bcy8M= X-Proofpoint-ORIG-GUID: kDzKrfFQciTTrBtSjiLbYfgel2l8NUkY X-Proofpoint-GUID: kDzKrfFQciTTrBtSjiLbYfgel2l8NUkY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 adultscore=0 clxscore=1015 priorityscore=1501 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090174 A few nodes do have "device_type" property which is mostly, but not always, the first property in a device node, when applicable. Adjust the DTS coding style rules to actually expect the device_type first and improve the dt-check-style to handle this correctly. Signed-off-by: Krzysztof Kozlowski --- Changes in v3: New patch --- .../devicetree/bindings/dts-coding-style.rst | 15 ++++---- scripts/dtc/dt-check-style | 33 +++++++++-------- .../dt-style-selftest/bad/dts-property-order.dts | 43 ++++++++++++++++++= ++++ .../bad/yaml-prop-order-device-type.yaml | 31 ++++++++++++++++ .../expected/dts-property-order.dts.txt | 6 +++ .../expected/yaml-prop-order-device-type.yaml.txt | 2 + .../dt-style-selftest/good/dts-property-order.dts | 41 ++++++++++++++++++= +++ 7 files changed, 149 insertions(+), 22 deletions(-) diff --git a/Documentation/devicetree/bindings/dts-coding-style.rst b/Docum= entation/devicetree/bindings/dts-coding-style.rst index 4a02ea60cbbe..63648db377e1 100644 --- a/Documentation/devicetree/bindings/dts-coding-style.rst +++ b/Documentation/devicetree/bindings/dts-coding-style.rst @@ -114,15 +114,16 @@ Order of Properties in Device Node =20 The following order of properties in device nodes is preferred: =20 -1. "compatible" -2. "reg" -3. "ranges" -4. Standard/common properties (defined by common bindings, e.g. without +1. "device_type" (if applicable) +2. "compatible" +3. "reg" +4. "ranges" +5. Standard/common properties (defined by common bindings, e.g. without vendor-prefixes) -5. Vendor-specific properties -6. "status" (if applicable), preceded by a blank line if there is content +6. Vendor-specific properties +7. "status" (if applicable), preceded by a blank line if there is content before the property -7. Child nodes, where each node is preceded with a blank line +8. Child nodes, where each node is preceded with a blank line =20 The "status" property is by default "okay", thus it can be omitted. =20 diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index f5276b5fdd46..d19ef26c2213 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -565,28 +565,31 @@ def check_child_name_order(ctx): =20 def _property_bucket(name): """Return the canonical bucket index for a property: - 0 compatible - 1 reg / reg-names - 2 ranges - 3 standard properties (no vendor comma in #-stripped name) - 4 vendor-specific properties - 5 status - Plus a sub-key inside the bucket for fixed slots (compatible, reg, - reg-names, ranges, status). 'standard' and 'vendor' return None for + 0 device_type + 1 compatible + 2 reg / reg-names + 3 ranges + 4 standard properties (no vendor comma in #-stripped name) + 5 vendor-specific properties + 6 status + Plus a sub-key inside the bucket for fixed slots (device_type, compati= ble, + reg, reg-names, ranges, status). 'standard' and 'vendor' return None f= or the sub-key, signalling that the within-bucket key is computed by the pairing rules.""" stripped =3D name.lstrip('#') - if name =3D=3D 'compatible': + if name =3D=3D 'device_type': return (0, 0) - if name =3D=3D 'reg': + if name =3D=3D 'compatible': return (1, 0) - if name =3D=3D 'reg-names': - return (1, 1) - if name =3D=3D 'ranges': + if name =3D=3D 'reg': return (2, 0) + if name =3D=3D 'reg-names': + return (2, 1) + if name =3D=3D 'ranges': + return (3, 0) if name =3D=3D 'status': - return (5, 0) - return (4 if ',' in stripped else 3, None) + return (6, 0) + return (5 if ',' in stripped else 4, None) =20 =20 # Declarative pairing rules: each is a callable diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts b/scr= ipts/dtc/dt-style-selftest/bad/dts-property-order.dts new file mode 100644 index 000000000000..f31abb6ceae4 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Incorrect property order + */ + +/dts-v1/; + +/ { + cpus { + #address-cells =3D <1>; + #size-cells =3D <0>; + + cpu@0 { + reg =3D <0x0 0x0>; + compatible =3D "arm,cortex-a57"; + device_type =3D "cpu"; + enable-method =3D "psci"; + }; + }; + + pmu { + compatible =3D "example,pmu"; + + status =3D "disabled"; + dma-coherent; + }; + + soc@0 { + ranges =3D <0 0 0 0xc0000000>; + compatible =3D "simple-bus"; + + #address-cells =3D <1>; + #size-cells =3D <1>; + + interrupt-controller@10000 { + reg =3D <0x10000 0x1000>; + interrupts =3D <1 2 3>, + <4 5 6>, + <7 8 9>; + compatible =3D "example,intc"; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.= yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml new file mode 100644 index 000000000000..e2c69e9ff452 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-bad-prop-order.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with device_type + +maintainers: + - Test User + +properties: + compatible: + const: example,test-prop-order-device-type + reg: + maxItems: 1 + device_type: true + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + device@1000 { + compatible =3D "example,test-prop-order-device-type"; + device_type =3D "cpu"; + reg =3D <0x1000 0x100>; + }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.= txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt new file mode 100644 index 000000000000..4bc21328625f --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt @@ -0,0 +1,6 @@ +# mode=3Dstrict +bad/dts-property-order.dts:15: [property-order] property 'compatible' out = of canonical order (should sort before 'reg') +bad/dts-property-order.dts:16: [property-order] property 'device_type' out= of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:25: [property-order] property 'dma-coherent' ou= t of canonical order (should sort before 'status') +bad/dts-property-order.dts:30: [property-order] property 'compatible' out = of canonical order (should sort before 'ranges') +bad/dts-property-order.dts:40: [property-order] property 'compatible' out = of canonical order (should sort before 'interrupts') diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order-device-= type.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order-devi= ce-type.yaml.txt new file mode 100644 index 000000000000..9350e2b80f75 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order-device-type.ya= ml.txt @@ -0,0 +1,2 @@ +# mode=3Dstrict +bad/yaml-prop-order-device-type.yaml:29: example 0 [property-order] proper= ty 'device_type' out of canonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts b/sc= ripts/dtc/dt-style-selftest/good/dts-property-order.dts new file mode 100644 index 000000000000..0e183e3459cd --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Incorrect property order + */ + +/dts-v1/; + +/ { + cpus { + #address-cells =3D <1>; + #size-cells =3D <0>; + + cpu@0 { + device_type =3D "cpu"; + compatible =3D "arm,cortex-a57"; + reg =3D <0x0 0x0>; + enable-method =3D "psci"; + }; + }; + + pmu { + compatible =3D "example,pmu"; + dma-coherent; + + status =3D "disabled"; + }; + + soc@0 { + compatible =3D "simple-bus"; + ranges =3D <0 0 0 0xc0000000>; + + #address-cells =3D <1>; + #size-cells =3D <1>; + + interrupt-controller@10000 { + compatible =3D "example,intc"; + reg =3D <0x10000 0x1000>; + interrupts =3D <1 2 3>; + }; + }; +}; --=20 2.53.0 From nobody Mon Jul 27 22:50:49 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7530B4195B4 for ; Thu, 9 Jul 2026 17:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618906; cv=none; b=TzoLxywzO/sgIros8pDvc0CDV1Q005hB4vrJ133UzPFoEf4GfitXZVTU0HlCMSZU1HwgOeAbNFTbZFi992m9futE3VYEfWNBwHHRPLXJLRntTS2IajNBpAzpyDUi/wiv3JjrqUkQLivALAGoGVJKiR8Svmn0NOA4kv/YyQ2IUEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618906; c=relaxed/simple; bh=HbDHhLgOl729fEDYEn3GHHtDxijoT4kwtCgdIa2fMTo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pTd3E5xisVr24ggwCFG7woTd7jfVCCU1CegtO9vZgmZkyoVrUUVLpOoeCdLngeb1UespQ1uOaL2DSW7imf+pU6UhE93gP3fC4vHSYm4h2uWMQmmMgyX9SytH7vyCV3TYtX32A+2WuYeeCJ8MF8DH3k5Y4LZSLXxLIVYhoZuaelo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=C+w5cxU9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=SulFaoTW; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="C+w5cxU9"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="SulFaoTW" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669HX3ZJ2295128 for ; Thu, 9 Jul 2026 17:41:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= P3q/rRtUnUE3CGutJGERiIiNbS2WKc4uDZITOx7V+bk=; b=C+w5cxU9Hoc1UIo0 Ic/TCGpmm+tlef18uWhvS39bUF/wwWqO147R+JPdwCXAsla2RfIRkpzmcHuo1xrz Rx6wr5d0SOE/xMedfyrCxgrEA9/E5zegS8zA4fMV7EX6D1Tl3c1q/7kZX3L5hWrK cWqDC9xgKXaU2k49pVhwHMm5geeRy5+uxFlZRDnUczkbTwL9tHObaGY0vpiV1P3Y K+JtivrmmYdeymRE33NtOujnt/uIkl/b9V7z2De08BjmZrqfOqjEu4LeuYhe0R9r dgLPn8TiYn9M2bGi8QfLhhZMDNutEESoQ7z9Vyjj8dy+BVqCS1zSgFGMzJaWRkkx X4yxSw== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fa55vkf7k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 17:41:44 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c0e702df8so288361cf.2 for ; Thu, 09 Jul 2026 10:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783618904; x=1784223704; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=P3q/rRtUnUE3CGutJGERiIiNbS2WKc4uDZITOx7V+bk=; b=SulFaoTWDbdyjMvrfjjltR83mfgb9Rj/utjJ7XLHcbevBIzxnprh3UPfRR1czVhYem kxfXKp3kd4XapWKzzInfkzzk/v+0LRjC/fvYsPJ7S6XQ8c7LrjD57Fjpa5YXviGa8zts ucoqsOXNQrza0gqGVnYS3n1Vtu64abIEP8vrvp2Fnph77x0dRpitMR2snyVAReZadPDQ ox9cWs3IK7ACjfaRNNOCsYSL1ftQSZffzNSeNq1ej4IAhv/KlN3/IH8xF5FDD8k3WhVY jrtnfzMWHUtfLc5Jgwk5GnR75pfSHtgvXEQNASbjSbcD+sZF4fvvVuNe8/P7rJM40B3N /y7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783618904; x=1784223704; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=P3q/rRtUnUE3CGutJGERiIiNbS2WKc4uDZITOx7V+bk=; b=k4lyHLmgzng3GDTMshDKvGZ8ZscVFihxGc6TfzzKoMRWQIo2asMG1AQC48mx+d82xT IPl2WugcmUFLfi9ar9PiEPR6YP/v8MlJM/l/hYdyA4ZfJujTVxFpobFIuq8UM0Zzs4c9 134nNLWim05xiB9dOl+7Z4C4q+AbgWa7nXksSng7RymIYO6lVu4BRKJSYLLpWrMuJzpS XafkSjyr+3pRmfihNBLL8tLIsg8N0+snE85NBS1AZqzjVzECSIdI0IYWOLB0BFKmis9E E0WUNs7Nef+AP09BimQevXxJYkfYIHlqW1M1l5+INCcHdVvf7/a37u556NIAS5IF0UNw ZVjg== X-Forwarded-Encrypted: i=1; AHgh+Rqrcp/RnrmaOhezS1HFv4l5gMEWDPxMncm0LraPMHRBn/dI/b76x/m2/zm4Ir1BcVmjbpZHfPAGbbswn00=@vger.kernel.org X-Gm-Message-State: AOJu0YzWeyYVjEWri8qGGWYWOvDJ8MaqiQdXS7/WCd/zXVYTKtVhaijZ VzVc380ghd55k4IZixcd/5M5ehKNHeVEcsMuu6ASIt5j7jHSLCRqGCvZxvcg2VoZ3XQRJ+BbF2I 1GX4bW41t+q/fXuwz0j71JDezGZNAHxNKwvdQ7N08NEMv/ZZwbgTFMP1AobA7Yxfax1g= X-Gm-Gg: AfdE7clo7D8DMG1JmwTBG1D1fBfyAQSRdGF0DE2W7/NaDlO8oL8veZHFAkh0DUR0K2T x3bi76clTyv85eMt9boAoHQ2KafPIsyPB3t2C9/dLfBzTjm0hJ90k7gFnKJ80lYYMbqQGW9g3Tc v/C2SHjhMuFjyP6gh4YGJje1JfcS6g4Y4XCsPlt6BthfPq4lBHdtI/m29CWsoc8zIavWiDg7A6I LyiQmOQI9sYCRfuIMoKgK7heg+O7K/FHjhsqvUjHeVi8MFQg2SERrYHCGlazK10CpOFQ2YpMaWB jXmxIKC0qt2HVQTgsohvbrV18IItqcgOlOp/kH3sYV5IhjhFAOe5i1a9YWVa4EKkiHlHPGg0HPN IKB0XZjomAtNCz4Fk4tWor0/zEKeW0sla X-Received: by 2002:a05:622a:1819:b0:51b:f549:c706 with SMTP id d75a77b69052e-51c8b2a9ba0mr86214381cf.16.1783618903729; Thu, 09 Jul 2026 10:41:43 -0700 (PDT) X-Received: by 2002:a05:622a:1819:b0:51b:f549:c706 with SMTP id d75a77b69052e-51c8b2a9ba0mr86214091cf.16.1783618903214; Thu, 09 Jul 2026 10:41:43 -0700 (PDT) Received: from [127.0.1.1] ([213.55.184.23]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039bcdasm55174048f8f.21.2026.07.09.10.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 10:41:42 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 09 Jul 2026 19:41:33 +0200 Subject: [PATCH v5 5/7] dtc: dt-check-style: Handle properly DTC-style includes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260709-dts-style-checker-v5-5-fcc147cb697d@oss.qualcomm.com> References: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> In-Reply-To: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> To: Rob Herring , Saravana Kannan , Krzysztof Kozlowski , Conor Dooley , Test User Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Golle , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX+t03DTw4LTKY sQ5nru5tjLcIQ1um4Xmj34hJ+wi4U1+J5je/pwE/i94BrKkDAib5oKrcuI/zxl1Cx50jEj3K3Sr MbbzKOiDZO54bFoAljp93TNu0vO/o3LRXmdKgdtbQk0hBUaIb3W19JpDdbeaogPBWPtz4YE3lG6 Y0ZL10vh9BcbOOw9ZfSmURkzWAD/ilmKYLNpNGqkEZ8pza3N+R5JzzJh7KmplDeAX0i8apMz98C WZnIXIoZIJU1yLAwgH/fsoh1aTvhpBLJ0oALgIroHz5uRUnX7WAwahKcYiKYsNoo1W79Y58t9it rpHNfWCOV4eQ+Ux5jbl7OQa3iYM48Ae1OLMRwqS8YJO1WQsaTvBWFptHt0g0LQzNmNA/OEPeW3g em28llPcPw9qPVsdORl9Xoa+GTQ3KoZsPEfv8p2holOqLL9TPd+OepF9UV9BhrbEIAUjC0asWGu ttloLNqMkd8uP5nZl/w== X-Authority-Analysis: v=2.4 cv=KfDidwYD c=1 sm=1 tr=0 ts=6a4fdd58 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=nvVmADDuAioZMzk/ZEnfEw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=0y9rCkXEhHseLPfnHlwA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfXxa7gRnN+tZMr lCppVTD16xkaMJC7xdqzHz5U6cUM6Ps1S6RjGeCW96aixCxzKNXLPa6hBsjF/8+S9dU+hqPZEZf eR8Nw5j6gE2/8S+jqEtX/3TsUd+AOq0= X-Proofpoint-ORIG-GUID: vX6QCuMPP2kA_ZQjMmUUcSAJ7TQJsPv7 X-Proofpoint-GUID: vX6QCuMPP2kA_ZQjMmUUcSAJ7TQJsPv7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 adultscore=0 clxscore=1015 priorityscore=1501 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090174 dt-check-style was not properly handling DTC directives (starting with '/', e.g. /dts-v1/ or /include/), thus a few DTS files had false positive like: apm/apm-merlin.dts:1: [indent-unit-dts] indent unit must be 1 tab in DTS,= got '\t\t' Signed-off-by: Krzysztof Kozlowski --- Changes in v3: New patch --- scripts/dtc/dt-check-style | 11 ++++- scripts/dtc/dt-style-selftest/good/dts-dtc.dts | 21 ++++++++++ .../dt-style-selftest/good/dts-preprocessor.dts | 21 ++++++++++ scripts/dtc/dt-style-selftest/good/soc.dtsi | 47 ++++++++++++++++++= ++++ 4 files changed, 98 insertions(+), 2 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index d19ef26c2213..ad07b0d27470 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -49,6 +49,9 @@ re_cpp_directive =3D re.compile( r'^#\s*(include|define|undef|ifdef|ifndef|if|else|elif|endif|' r'pragma|error|warning)\b') =20 +re_dtc_directive =3D re.compile( + r'^/(dts-v1|include)/') + # label: name@addr { -- label and addr optional; name can be "/" # Per the DT spec a node name may start with a digit (e.g. 1wire@...). # The address part is captured loosely (any non-space, non-brace run) so @@ -66,7 +69,11 @@ re_ref_node =3D re.compile( =20 def is_preprocessor(stripped): """Tell C preprocessor directives apart from DTS '#'-prefixed props.""" - return re_cpp_directive.match(stripped) is not None + if re_cpp_directive.match(stripped) is not None: + return True + if re_dtc_directive.match(stripped) is not None: + return True + return False =20 =20 class DtsLine: @@ -178,7 +185,7 @@ def classify_lines(text): out.append(dl) continue =20 - if stripped.startswith('#') and is_preprocessor(stripped): + if (stripped.startswith('#') or stripped.startswith('/')) and is_p= reprocessor(stripped): dl =3D DtsLine(i, raw, LineType.PREPROCESSOR, indent_str, stripped) dl.depth =3D depth diff --git a/scripts/dtc/dt-style-selftest/good/dts-dtc.dts b/scripts/dtc/d= t-style-selftest/good/dts-dtc.dts new file mode 100644 index 000000000000..a3207196214c --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-dtc.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: dtc directive + */ + +/dts-v1/; + +/include/ "soc.dtsi" +/include/"soc-other.dtsi" + +/ { + compatible =3D "example,test-board"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + leds { + led-0 { + compatible =3D "example,led"; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/good/dts-preprocessor.dts b/scri= pts/dtc/dt-style-selftest/good/dts-preprocessor.dts new file mode 100644 index 000000000000..bd6d9dddec73 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-preprocessor.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: preprocessor directive + */ + +/dts-v1/; + +#include "soc.dtsi" +#include + +/ { + compatible =3D "example,test-board"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + leds { + led-0 { + compatible =3D "example,led"; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/good/soc.dtsi b/scripts/dtc/dt-s= tyle-selftest/good/soc.dtsi new file mode 100644 index 000000000000..c60274469555 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/soc.dtsi @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/ { + #address-cells =3D <1>; + #size-cells =3D <1>; + + cpus { + #address-cells =3D <1>; + #size-cells =3D <0>; + + cpu@0 { + device_type =3D "cpu"; + compatible =3D "arm,cortex-a57"; + reg =3D <0x0 0x0>; + enable-method =3D "psci"; + }; + }; + + pmu { + compatible =3D "example,pmu"; + }; + + soc@0 { + compatible =3D "simple-bus"; + ranges =3D <0 0 0 0xc0000000>; + + #address-cells =3D <1>; + #size-cells =3D <1>; + + interrupt-controller@10000 { + compatible =3D "example,intc"; + reg =3D <0x10000 0x1000>; + interrupts =3D <1 2 3>, + <4 5 6>, + <7 8 9>; + }; + + serial@20000 { + compatible =3D "example,serial"; + reg =3D <0x20000 0x1000>; + }; + + serial@30000 { + compatible =3D "example,serial"; + reg =3D <0x30000 0x1000>; + }; + }; +}; --=20 2.53.0 From nobody Mon Jul 27 22:50:49 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 275984195A5 for ; Thu, 9 Jul 2026 17:41:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618912; cv=none; b=gMJCtU1hgrluCLhk47nZ8PQhNQX5sY/4NSk0fdeX71jfjksjZPI+qp7lcW2trvsNCUVzg7zur/s9XxRwt3iylrX4Ka65CJ+XV9qhGG36zAfcRvUv55oR2PNKc4p+zoDSaFKaXheyngF6KmUl8ozPgOD21lCyKjhdoDfcl3e/yCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618912; c=relaxed/simple; bh=31Yek430e1uqebAy9ZELLFearIkajkO02QdXaEoVJTs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BPoj5973fauTn0Eik+fnn/YqbY3hGspJyckUEldDXBUwhCsFikqU7p99c6Ex9J/EsRGYPuVS/s1fI/n94Xc+qzj0sAZLDcJAHPxiETg0Kb3Wtc5s3nXfqJ8ryXDBfsqqpUVH4nmsWHrwZwGCFwhcWFY4TWHRXIBNlGUTydeIm10= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=fbxeSIWC; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=SwHv9PQc; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="fbxeSIWC"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="SwHv9PQc" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669HXKsQ2518770 for ; Thu, 9 Jul 2026 17:41:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= uuXgEvlASP0UBHjE/3eYOsropkXJkf6Cj4VcoOnjcDk=; b=fbxeSIWChabMSLlz uq+IGhAkbWJMqeNz8fmqMngPZQ2FEbaHwHT5Z9Fxa/aZnGWJyiNSwIlD6sFiyXwm iSuhAOFRfn8+uGH+BxEW9jzmVwhXta7cLphJqglnrPd7POTrYtpquHbepAWe8qWu Xf0IOuRhwLsFzNRUvR6ZVssPnlvk3OHQiWS0wX2oSjJhVanPj6qA7qS1owvsmCHg DasRAY1Aja/+Y1nSNAWJ4w86Swo1toCHVDSV2+guj1CEBkP2dX9HkIrOhSN+BKk3 LsnzSb0DEFeDKxyujsUFCu3cDBolDXwqeRXVBXD0SiV6sLFn82f5jSDXg2H7BSMB k2JW4A== Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4faekn8ncj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 17:41:48 +0000 (GMT) Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-8f1d3eeab92so2518396d6.1 for ; Thu, 09 Jul 2026 10:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783618907; x=1784223707; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uuXgEvlASP0UBHjE/3eYOsropkXJkf6Cj4VcoOnjcDk=; b=SwHv9PQc8gKnmkWcNb4CH9DLjPs29EsWTR3TVyTE0upLCwsrcFk6MgGuVIrSjCRrKY YJzk6Td6IHEIwS8/dOp3cU/rNXkjEmwvmxjvsDcdHX3sPlZKqPamPyxH3S/Lf9UD+gch lXrzRrkCknEdcHJF09Oaj934Vrotk7hstyjvuU9vo06/eKTFXZOqnhlZ8OrmX7IhB0BF k/RdwUSXBQqgW9uCXLGzBP3S/1waqk/TzY9bHmiJnOUVxnEwddBG8LKFAoecmFJo9iWM 4/CYtKktQsilkzCG+xErn3cdnl3KM/932HrfROfXBhY9jG7Ew0zjmCOjLK8HgRr7i9co V0GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783618907; x=1784223707; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uuXgEvlASP0UBHjE/3eYOsropkXJkf6Cj4VcoOnjcDk=; b=G3BPj/7jiItV7TEvVAzm+sJVipBX8bt8tmOUZizNBZccQn44/fcHmlxJD7g8c87Trh t4l/+MeeZnOLyZS5c7PdU1y3j/aTV9mwsypff22uO86J5JElBE0xOlcCTLhY1DsKzyNH /34dofqIUCWAI+BURo4OYV/BiUTZaeb3ZC2PC9srOzQ+K6WlllFLF7jRWJ6qVLI9cJAc 5onkAxWcUFmfpAxiVsK7aGIdM0TaXaQoWGSOm9o9qt6w5v0RiVTwI/rulm4XgYpxkgq3 NDBWNNYbD8JK8qmYxR9rIDyb92s8ECEzg74MRE8zTFajg5pQs1I+hbRqeSl3pO22W0pm 3oEQ== X-Forwarded-Encrypted: i=1; AHgh+Ro3FJL159fRVx6WN6qj3bH5i9XVl9FvlFWrU2SnW0WEKBuexArsJ+4jC+4VHDs7E2hNNU+OXkaiF3C3atU=@vger.kernel.org X-Gm-Message-State: AOJu0YzCvWTq0ZFglxHiGD7TgGTlPVcGAc8Uv/r/p4sV/Npiwaw9087p rJfmHq6Z2Ni6ewnP6buBaGqv+UkqJnzwC//dVX3EhZRNosIJ3AUNRSZk99lDgiWIr0s+9B+jzfb Pav1vy6CTMoB9cOL8vQhHzrRaA2KHI0v17/buZ7eJWyQgecarFP+QJeR3QcQs1mXyj11InxCaSs U= X-Gm-Gg: AfdE7ckYAUbHHMweRSOk11aLOx1ZmRK9Q8+Fdnm+5GRkUvPRFku8F4QcbZ3P/fpX7z6 bUwfXBYnjsuqox4MKrmnxNASQ67JG4CWoq9vlBpPS46B2b0Mm69LUBj6Pk/oh2mKdj7moQp4Vr/ WZ4vo7ZBmVBg9tViXKvcJC7Y/hrtJS0AZWcLniGN5ONxZaPEXUUyB8uGX7V8kSuzOUe8gaTPotM CsOuYE2M+STwbx7Qybmbfab1bpEN+0I3ZLXEOSV2Bo8owd6L8xySmGcWj7LkwipMmt4AHAv70iC i3yAPADkL500h15JH+4FhboNiK4OA2ADxDRo/5lI57fZStp9BebIotkkuYXLw1aKdBK1DZpfpzp f3lXxVlfDJHwpswN2N3yN5dBisAG9KS08 X-Received: by 2002:ac8:6f07:0:b0:51a:8c9c:7f3d with SMTP id d75a77b69052e-51c8b4fda49mr91384031cf.64.1783618907450; Thu, 09 Jul 2026 10:41:47 -0700 (PDT) X-Received: by 2002:ac8:6f07:0:b0:51a:8c9c:7f3d with SMTP id d75a77b69052e-51c8b4fda49mr91383621cf.64.1783618906920; Thu, 09 Jul 2026 10:41:46 -0700 (PDT) Received: from [127.0.1.1] ([213.55.184.23]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039bcdasm55174048f8f.21.2026.07.09.10.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 10:41:44 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 09 Jul 2026 19:41:34 +0200 Subject: [PATCH v5 6/7] dtc: dt-check-style: Print proper line number of indentation detection place Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260709-dts-style-checker-v5-6-fcc147cb697d@oss.qualcomm.com> References: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> In-Reply-To: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> To: Rob Herring , Saravana Kannan , Krzysztof Kozlowski , Conor Dooley , Test User Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Golle , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX4w5XJQwNuGXG p8eFZzcsAoTWll6xsb+UhHN6SVFi0YR8V9uLUUHFMZkH4T1X9UkxwmwvEJFmCAIoZXKKnwDSj5b ThV8y9+fKbzRZskLDM6KkzA5qpTf4KQ= X-Authority-Analysis: v=2.4 cv=SNlykuvH c=1 sm=1 tr=0 ts=6a4fdd5c cx=c_pps a=7E5Bxpl4vBhpaufnMqZlrw==:117 a=nvVmADDuAioZMzk/ZEnfEw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=PZs63ITsWf6chMizFqwA:9 a=QEXdDO2ut3YA:10 a=pJ04lnu7RYOZP9TFuWaZ:22 X-Proofpoint-GUID: EuLro5gollD3zU8-lHlDtUwB1Mnq18dQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX+xcKFQCvPEoF 2PC4zAlY5JP0uspjYdyszmNNmEpsVq7L1DV6zbnsJ+oWagWEHQOvglBQgvfWgwoXhgzfi50xZfd 1Tpqa1E2zksSFmTyQUETPvNJ0djsCYOt1OWuWCuQLijszXve6Bth9nSFNwbfkVc6U/zPu0SMdsv U2GCSpzCWp7ZzVFFwLXVOf6VN1ksMVkeXzjMgvfqlfAkxI85WuHR2RxLehF88AMzems5WQaJMXZ t7C/BPrkXNFMkpgNbysnC4F60nFyTEgrHyEvhLIL0JDBncCGo4hWVrZC+Bx8VxtKZOLAEv16ccF TnR0qrolj/JtxfmHUsBOV8afSrgA50O8RHg7Kh6gsTo2w7TXu7pmcVdG2S1Lsv9Rtm7RHcJPCrI YKHciI8kR28plxU9eL2FyFj7XZwo9NVJcsWE/MQY1E5uIXdCNHbyn0qcBtbQqLLnKgi++/6KQhm sV88toqYPMHrxB6oBKQ== X-Proofpoint-ORIG-GUID: EuLro5gollD3zU8-lHlDtUwB1Mnq18dQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 impostorscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090174 Script judges the indentation however always suggests it is the first line which is wrong, e.g.: sigmastar/mstar-infinity2m.dtsi:1: [indent-unit-dts] indent unit must be = 1 tab in DTS, got '\t\t' Signed-off-by: Krzysztof Kozlowski --- scripts/dtc/dt-check-style | 29 +++++++++++-------= ---- .../dt-style-selftest/expected/dts-spaces.dts.txt | 2 +- .../expected/yaml-indent-strict.yaml.txt | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index ad07b0d27470..3985923622e8 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -392,8 +392,9 @@ def check_mixed_indent_chars(ctx): def detect_indent_unit(ctx): """Find the indent unit used at depth 1 in this block. =20 - Returns one of: ' ' (2 spaces), ' ' (4 spaces), '\\t' (tab), - or None if depth-1 is empty or ambiguous.""" + Returns tuple of string (one of: ' ' (2 spaces), ' ' (4 spaces), + '\\t' (tab), or None if depth-1 is empty or ambiguous) and line number= when + detection was made).""" for dl in ctx.lines: if dl.depth !=3D 1: continue @@ -404,48 +405,48 @@ def detect_indent_unit(ctx): if not dl.indent_str: continue if dl.indent_str =3D=3D '\t': - return '\t' + return ('\t', dl.lineno) if dl.indent_str =3D=3D ' ': - return ' ' + return (' ', dl.lineno) if dl.indent_str =3D=3D ' ': - return ' ' + return (' ', dl.lineno) # Anything else at depth 1 is non-canonical; flag elsewhere. - return dl.indent_str - return None + return (dl.indent_str, dl.lineno) + return (None, None) =20 =20 def check_indent_unit_relaxed(ctx): """YAML examples: 2 or 4 spaces. Never tabs or other widths.""" - unit =3D detect_indent_unit(ctx) + (unit, lineno) =3D detect_indent_unit(ctx) if unit is None: return if unit not in (' ', ' '): - yield (1, 'indent unit must be 2 or 4 spaces, got %r' % unit) + yield (lineno, 'indent unit must be 2 or 4 spaces, got %r' % unit) =20 =20 def check_indent_unit_dts(ctx): """DTS files: 1 tab per level. Always required.""" - unit =3D detect_indent_unit(ctx) + (unit, lineno) =3D detect_indent_unit(ctx) if unit is None: return if unit !=3D '\t': - yield (1, 'indent unit must be 1 tab in DTS, got %r' % unit) + yield (lineno, 'indent unit must be 1 tab in DTS, got %r' % unit) =20 =20 def check_indent_unit_strict(ctx): """YAML: must be exactly 4 spaces. DTS: 1 tab (same as relaxed).""" - unit =3D detect_indent_unit(ctx) + (unit, lineno) =3D detect_indent_unit(ctx) if unit is None: return if ctx.file_type =3D=3D 'yaml': if unit !=3D ' ': - yield (1, 'indent unit must be 4 spaces in strict mode, ' + yield (lineno, 'indent unit must be 4 spaces in strict mode, ' 'got %r' % unit) =20 =20 def check_indent_consistent(ctx): """All indented lines must be a multiple of the detected unit.""" - unit =3D detect_indent_unit(ctx) + (unit, lineno) =3D detect_indent_unit(ctx) if unit is None: return if ctx.file_type =3D=3D 'yaml': diff --git a/scripts/dtc/dt-style-selftest/expected/dts-spaces.dts.txt b/sc= ripts/dtc/dt-style-selftest/expected/dts-spaces.dts.txt index 070025c4568c..5afdb101dcee 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-spaces.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-spaces.dts.txt @@ -1,2 +1,2 @@ # mode=3Drelaxed -bad/dts-spaces.dts:1: [indent-unit-dts] indent unit must be 1 tab in DTS, = got ' ' +bad/dts-spaces.dts:9: [indent-unit-dts] indent unit must be 1 tab in DTS, = got ' ' diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-indent-strict.yaml= .txt b/scripts/dtc/dt-style-selftest/expected/yaml-indent-strict.yaml.txt index 5ef290d3a847..c4f31deea4ca 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-indent-strict.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-indent-strict.yaml.txt @@ -1,2 +1,2 @@ # mode=3Dstrict -bad/yaml-indent-strict.yaml:26: example 0 [indent-unit-strict] indent unit= must be 4 spaces in strict mode, got ' ' +bad/yaml-indent-strict.yaml:27: example 0 [indent-unit-strict] indent unit= must be 4 spaces in strict mode, got ' ' --=20 2.53.0 From nobody Mon Jul 27 22:50:49 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 690A74195C1 for ; Thu, 9 Jul 2026 17:41:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618918; cv=none; b=cXOcvvX6YI5epjZINd5a/1AEtEOOCzES2suZAeIOKHTcPFq2pkV2EZkpQIz1wIz5U6q+gr7bS0Ivs+U1u1w1RBZj3iTVUadm4Tz/9zsRcVIIuvip0Zjy+pCgaYhLI93uf3Q03S6TtItqPk2oRsXk6Tf/9Z82RByWM+hE20Y5BZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783618918; c=relaxed/simple; bh=ZzYwHa+deDpA118pa8JLvznGNgQlLOdgQ29SOnIiH9g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nWDCf2Rci1RSo12qLgIN1QIirtuoJou6SW1uE/OnvTiQ5HphitjaVTCEmAxwjmvRGZwK6DNkKhH2hodb2Vzdp5K0uqyEqNRZEdKCGhpb8P613jG3SKrXVjihaJiXyKSLyB8sM5zMMkDflX5gvi3Tvo9r1bf8Fhp04DgDUVklgww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=UtlOx+2F; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iPQZzYko; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="UtlOx+2F"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iPQZzYko" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669HXpU12475813 for ; Thu, 9 Jul 2026 17:41:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= f/ok5P/KJKTJ44/y6GUKUWw0HNP+CMc3yaavgWV34ow=; b=UtlOx+2F64QOCPI7 xxbwfOeEwRhDO3nAis6Z1Oyl8Pudwhcr5vfKL0b10Ad7Z2DXguYRO0WkyucRb0Pq DIswWwUPW9o0RLdXpyg74AyKWmiiWm53pAwTT4HUV7hOvnzsVjex/ugkgmJwuRJI B0rsFa0h6VxA6A+E4k8rcWSyQHRhgTtfHOp7NonKOYFkPGjuidnKou8LqlkE4YVy aBllsXiMCQwGDxOBe2thcs5bAcP6JgJaWPl28Wj2fgRtJ9tR6evmkEW4NvTyB/fO +QvZZSDbOMMsXqU48EdFG2TnR5oFE3iWNvBZIGkqXlWValxBbmwVLonyDRQxkie/ kCBhPw== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4faf5mrdn9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 17:41:55 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c21c01cf3so432081cf.2 for ; Thu, 09 Jul 2026 10:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783618915; x=1784223715; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=f/ok5P/KJKTJ44/y6GUKUWw0HNP+CMc3yaavgWV34ow=; b=iPQZzYkofTx4/8huZCFivwMaa83F3iCsk7pxRSXXKrD8oNWAvUbJdjY2AnyVlnRzg2 GKyECP/HfRydBMblaEqCufL9mQjOt6oZjflZB3FdP2ZsQJDMUACLmNQPfqrZ5fNlo1Yf JhF7rc/D/4xTaxIFnZywQBSjPVbZFvuFWdut4EHkisW9Cj5Dr6MMhTRWjkeBjBaOOCxX fBSxdifxw7yZtFliWcgAsgosqV56Gbv3ESxuWPR5VIZHmEOkcTm6HLd8kxJf1u2bNuzn wU6/bWINn1LfPCzDGhd+TFBq8LaWx2agdRJ7Ndc2CAn6QTSVgne6XSnLo5uchNAGP4AZ C9HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783618915; x=1784223715; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=f/ok5P/KJKTJ44/y6GUKUWw0HNP+CMc3yaavgWV34ow=; b=Ji03v7QAYo6xGyxs+aJVF5iuVXYgENydFa1qP04ryD56Iy5cRfpEq0e3UhUsnyoWEG wtotyr3AOm9KSK020v0z/xyqSjjFZDqQiakt3bkQjOyaU3ReTHNXdFdRdDepmYjWciXH DtdkOFZOuhenuD7BcsVJKMcrRx68BWq1vFM8/60YsK2x0wvO6hcDA/yxnkoYbuuLfTkY uKr+m7FTEq1zu5dY5EIW6mpHQq7BiEDCnWwQvSC15Y9UxWRosJh8tpauHNznBUh9GVTD AJs3VHovDmTcPZbXnqHpCr9V1cL97RUtPPwbxYBtuETP2wL/10zOso1+jL3jaV+/YZfE 2ejg== X-Forwarded-Encrypted: i=1; AHgh+RpQunIPtZ8p0XYWxtNOCziopwsvm7WEc7m/oQtGuzNIIhtuR4OxBuRPwJ6A4CH3jlzS+P4sU8V1MH3TIP8=@vger.kernel.org X-Gm-Message-State: AOJu0YzwMWYg3VTh+jQfQ9JLjN8Y7K31FhHKhadjTHiBD3RPxl2HZMkv dCeXeGCNvaN9g1NGkvqIdHWPDQspxKo/dFxCzy047Bc4RZWdPtmYmyvTYA7bRey2h5LnrbfcaKq O0KQXWA1zCf6N2lglK6YOH0qE17h/YHS+xWcc7XV3eYSnPpK9mSmYdUjNqsP+DHS5DPY= X-Gm-Gg: AfdE7clCyX6mWZXwZ/VVz70nmk2UQaEEep27I1wJ9SNbSfB8G1QU+iX4KkWGKsWPFGj iE9C0b4By9WR9URxmexi2bDXS9u8sUK8YNlzWM++a3TtIScgV+cnHahO+GA9zCiGSSa3mmUz9f3 ILTyca3nDphfbp8jq1RI/qS4IsUhVvbxvolCLTVMnBtcuEDxL0Ucnl49EdtRyDfdNgl4VgXkqKY 95Q9hVU6CEteOpAX+QH2KalQ1sI8Ig2Ml0myqJsSrmeRIVSgJ5LBTG4AnMUbCNad9oqQFTnf7DD UnPNBTTnNKVfcfLPcDBQdknkNXcpqe3vJQEJR7UdXzErzeneLXB8Tbi2vPLP4fnVqRkus6o8Mob FgbsE/h29Ngun89toUYg7/8j2QL6HQajU X-Received: by 2002:a05:622a:1f0e:b0:51c:2149:52db with SMTP id d75a77b69052e-51c8b4ba4damr85950701cf.59.1783618914586; Thu, 09 Jul 2026 10:41:54 -0700 (PDT) X-Received: by 2002:a05:622a:1f0e:b0:51c:2149:52db with SMTP id d75a77b69052e-51c8b4ba4damr85947841cf.59.1783618909379; Thu, 09 Jul 2026 10:41:49 -0700 (PDT) Received: from [127.0.1.1] ([213.55.184.23]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039bcdasm55174048f8f.21.2026.07.09.10.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 10:41:47 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 09 Jul 2026 19:41:35 +0200 Subject: [PATCH v5 7/7] dtc: dt-check-style: Add more DTS test cases Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260709-dts-style-checker-v5-7-fcc147cb697d@oss.qualcomm.com> References: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> In-Reply-To: <20260709-dts-style-checker-v5-0-fcc147cb697d@oss.qualcomm.com> To: Rob Herring , Saravana Kannan , Krzysztof Kozlowski , Conor Dooley , Test User Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Golle , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: S7pvPugVv_o4-uz3ON74tlGJXclvh9ND X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX3a8eACzW2J2s HgtpRn+PFMdh1n6L2KoaD9YuK5yQwDpGBBkE/30KM9YAkCmb5uvXiI2tJI66XDfX5lFBkQVBoem hVk6EC5l20CBJ55x2/1IBZYrUu54UaY= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDE3NCBTYWx0ZWRfX26cOZWqfQoGU y8FDLkEsg6IEXvQpMjVArC6lq4bMqZJPjw14ByW7qR2qprparLumUdbfARxSBnleUMuLs9JBlth tCEqWhx4kMDMyy7zQ7PGlkQBKvpp4PgsSlBlKyRS8jywEDQECjzypEUP8g6hVKG+TgfkmkUJnFR rq4BzYOeFcLdgJrntewF+YXoUV4GG64Tb8JW9WjjUeNXr+2i3RJMvXSUCuxg/jYAYsX+VKzOeTG 7cp4p83wShJdLf9e5mOpd7Xbp4DfffhmW1suKD24SMbGbEARQlGLmMb6VCZzjuGcRlmkzH0RcCJ sC3CJ8n0gZGRnBTOUzPHAPGcWpz068ULQePyHfsyCyrNPSUPTMrL3b1YRn9SGNegPkwq4dQgH7V WPQd2TogBtv1+mugQ8Ls2NJ9DOsOQSHmEfhdwJVCQwNzpi070//70jI1oed48Tl8tAggY4ok+rp 4V4KjeM0mZjYTFUlAvQ== X-Proofpoint-GUID: S7pvPugVv_o4-uz3ON74tlGJXclvh9ND X-Authority-Analysis: v=2.4 cv=N+QZ0W9B c=1 sm=1 tr=0 ts=6a4fdd63 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=nvVmADDuAioZMzk/ZEnfEw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=SSRPy7KZV2plhviXFSUA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0 adultscore=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090174 Add a few more test cases for valid and incorrect DTS for dt-check-style. Signed-off-by: Krzysztof Kozlowski --- Changes in v4: 1. New patch --- .../dt-style-selftest/bad/dts-child-name-order.dts | 30 ++++++++++++++++ .../bad/dts-extend-node-child-name-order.dts | 23 ++++++++++++ .../bad/dts-extend-node-digit-node-order.dts | 31 ++++++++++++++++ .../expected/dts-child-name-order.dts.txt | 2 ++ .../dts-extend-node-child-name-order.dts.txt | 2 ++ .../dts-extend-node-digit-node-order.dts.txt | 2 ++ .../good/dts-child-name-order.dts | 30 ++++++++++++++++ .../good/dts-digit-node-order.dts | 41 ++++++++++++++++++= ++++ .../good/dts-extend-node-child-name-order.dts | 23 ++++++++++++ .../good/dts-extend-node-digit-node-order.dts | 31 ++++++++++++++++ 10 files changed, 215 insertions(+) diff --git a/scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dts b/s= cripts/dtc/dt-style-selftest/bad/dts-child-name-order.dts new file mode 100644 index 000000000000..49c5c10c92d7 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/ { + #address-cells =3D <1>; + #size-cells =3D <1>; + + pmu { + compatible =3D "example,pmu"; + + /* Include labels to be sure they do not affect sorting */ + foo: foo { + label =3D "foo"; + }; + + label_bar: bar { + label =3D "bar"; + }; + }; + + memory@a0000000 { + device_type =3D "memory"; + reg =3D <0x0 0xa0000000 0x0 0x0>; + }; + + pmu-2 { + compatible =3D "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo =3D <&foo>, <&label_bar>; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-o= rder.dts b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-ord= er.dts new file mode 100644 index 000000000000..575dadd03c38 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/ { + #address-cells =3D <1>; + #size-cells =3D <1>; + + pmu { + compatible =3D "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo =3D <&foo>, <&label_bar>; + }; +}; + +&pmu { + /* Include labels to be sure they do not affect sorting */ + foo: foo { + label =3D "foo"; + }; + + label_bar: bar { + label =3D "bar"; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-o= rder.dts b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-ord= er.dts new file mode 100644 index 000000000000..f3ffc47365a3 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dts @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/ { + #address-cells =3D <1>; + #size-cells =3D <1>; + + soc: soc@0 { + compatible =3D "simple-bus"; + ranges =3D <0 0 0 0xc0000000>; + + #address-cells =3D <1>; + #size-cells =3D <1>; + }; +}; + +&soc { + serial@20000 { + compatible =3D "example,serial"; + reg =3D <0x20000 0x1000>; + }; + + interrupt-controller@10000 { + compatible =3D "example,intc"; + reg =3D <0x10000 0x1000>; + interrupts =3D <1 2 3>; + }; + + serial@30000 { + compatible =3D "example,serial"; + reg =3D <0x30000 0x1000>; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dt= s.txt b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt new file mode 100644 index 000000000000..86b1de9bd654 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt @@ -0,0 +1,2 @@ +# mode=3Dstrict +bad/dts-child-name-order.dts:14: [child-name-order] child node 'bar' out o= f name order diff --git a/scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-n= ame-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-= child-name-order.dts.txt new file mode 100644 index 000000000000..e3d8fd367e09 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-ord= er.dts.txt @@ -0,0 +1,2 @@ +# mode=3Dstrict +bad/dts-extend-node-child-name-order.dts:20: [child-name-order] child node= 'bar' out of name order diff --git a/scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-n= ode-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-= digit-node-order.dts.txt new file mode 100644 index 000000000000..525081867bf7 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-ord= er.dts.txt @@ -0,0 +1,2 @@ +# mode=3Dstrict +bad/dts-extend-node-digit-node-order.dts:21: [child-address-order] child n= ode @10000 out of address order diff --git a/scripts/dtc/dt-style-selftest/good/dts-child-name-order.dts b/= scripts/dtc/dt-style-selftest/good/dts-child-name-order.dts new file mode 100644 index 000000000000..d2a278763c3c --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-child-name-order.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/ { + #address-cells =3D <1>; + #size-cells =3D <1>; + + memory@a0000000 { + device_type =3D "memory"; + reg =3D <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible =3D "example,pmu"; + + /* Include labels to be sure they do not affect sorting */ + label_bar: bar { + label =3D "bar"; + }; + + foo: foo { + label =3D "foo"; + }; + }; + + pmu-2 { + compatible =3D "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo =3D <&foo>, <&label_bar>; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts b/= scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts new file mode 100644 index 000000000000..d2bf5861c3ee --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/ { + #address-cells =3D <1>; + #size-cells =3D <1>; + + /* TODO: uncomment when child-address-order is fixed for top-level */ + /* + memory@a0000000 { + device_type =3D "memory"; + reg =3D <0x0 0xa0000000 0x0 0x0>; + }; + */ + + pmu { + compatible =3D "example,pmu"; + }; + + soc@0 { + compatible =3D "simple-bus"; + ranges =3D <0 0 0 0xc0000000>; + + #address-cells =3D <1>; + #size-cells =3D <1>; + + interrupt-controller@10000 { + compatible =3D "example,intc"; + reg =3D <0x10000 0x1000>; + interrupts =3D <1 2 3>; + }; + + serial@20000 { + compatible =3D "example,serial"; + reg =3D <0x20000 0x1000>; + }; + + serial@30000 { + compatible =3D "example,serial"; + reg =3D <0x30000 0x1000>; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-= order.dts b/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-o= rder.dts new file mode 100644 index 000000000000..47fe5455edfa --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.d= ts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/ { + #address-cells =3D <1>; + #size-cells =3D <1>; + + pmu { + compatible =3D "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo =3D <&foo>, <&label_bar>; + }; +}; + +&pmu { + /* Include labels to be sure they do not affect sorting */ + label_bar: bar { + label =3D "bar"; + }; + + foo: foo { + label =3D "foo"; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-= order.dts b/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-o= rder.dts new file mode 100644 index 000000000000..0c292fefa52a --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.d= ts @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/ { + #address-cells =3D <1>; + #size-cells =3D <1>; + + soc: soc@0 { + compatible =3D "simple-bus"; + ranges =3D <0 0 0 0xc0000000>; + + #address-cells =3D <1>; + #size-cells =3D <1>; + }; +}; + +&soc { + interrupt-controller@10000 { + compatible =3D "example,intc"; + reg =3D <0x10000 0x1000>; + interrupts =3D <1 2 3>; + }; + + serial@20000 { + compatible =3D "example,serial"; + reg =3D <0x20000 0x1000>; + }; + + serial@30000 { + compatible =3D "example,serial"; + reg =3D <0x30000 0x1000>; + }; +}; --=20 2.53.0