From nobody Mon Jul 27 22:11:27 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 60090285CB4 for ; Wed, 8 Jul 2026 14:40:54 +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=1783521656; cv=none; b=hND6CARIG5O2QdOo19i75oEj2MWdv8KtKuUV0heFiW7TmnjVh4CThPJWm5De20IH9V1/mD6pLm9KeUIesD9H+9lQPy9eK20Gf4IlfX//bwfTbDI6T08OZxMi9JPSsM/5JrpKY+PeFu6I9mi/C3TDQnJLqdXjSJUSYk1YPD43Sqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783521656; c=relaxed/simple; bh=G2bXd/eL1oQYJ0l760V735gooPZRhUjHojCT2I+xTys=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HXwapRcW7kCjUqGWvR5k6E6TIcbyFxrnvtZa0tY0wEJ64V+227Rk4H6+fN09TLeTWzTSMc0giGuAtLkdYTlnSqlPWWu6gDyFmqE6dOKf2qgI5nz+urw0jcR+PVV/Duz8Y8SFMbF/X0Dq+4lBAyhOoL3idpXKRUCNLP7pwu6fCUc= 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=eqwecQcT; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=A24EM34j; 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="eqwecQcT"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="A24EM34j" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 668C3DjE2751263 for ; Wed, 8 Jul 2026 14:40:53 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=eqwecQcTFr1OiPSL TndN2ddrRhP8ypovJvVfsXmjgDAdowguc7YyCUap9S57FFjpBW5g8IFqR/zcIAVJ DdmR1HDo41YpVVjpxpQ146BIhbRqZ+NVK1vD+AuuDeAwi4p7PcgwC6/UrqNwgXFP wUOaA1MMdCDzWn7NPiiIwkKj761elU8T9LsgABYEUJWSBRPuXjTkf24Uy5MIAHu7 2Cg0vblHYAlhN0dYUZRlYwJA1f5c84IfxUPqPp5Mp1Lwuf06cspNpTJj9GFp1iLQ vwtjc5FjMAAq3JOGwT04HxFxB457u0slnhNM0M6E2Pw/koMFA01MLbAnyLI6PvvU +qdR8w== 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 4f9g7hj76y-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 14:40:53 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c07f25de2so6318011cf.3 for ; Wed, 08 Jul 2026 07:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783521652; x=1784126452; 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=A24EM34jbu8xfqkuUEK18AWoDRYMAmNUy2SAbsnX4TYVcu7DfJAxbOynzIoaZDX8Fs MAR3Zc1Cy8QTGEn/4JUpde9UT6UqPfPgPUr9qsZnDy3uNGcOjb9wn1lpzUSWOc6eYW5M qJ5y6iS25xOYUnmeXOeRGGtbPt4qoafCSJ058s8UjJWJ/4XqL9V3gSQStNzv7AFs95aL mBZwpwseplOXR14vGgiKSqxP5lYwp3SAyYO1NWoSGpW18cLDtDICyG+n95EvvwGl7svG iC6+FooZM1Euvz4gMOfcYD+971Ah7swmS9czufVAOV46RfLVpXdHHuSFPOWQ6Wz9z5Zg deaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783521652; x=1784126452; 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=bcWFcXm3Jay2932nKKVGflkA117CtZre/NOFZ0puyQdoRdxl9W3BPE/SaGx0fdur2S 7UCVGMxPORAVaykGPgre5/EApdSihUnLlr9CnAExqHvJInFVX3FN1YeKypHzjRNgp8sq z3NsOtpSYOz5s9080sQVk5GCXivLH5Ns/R3JxZdg/hpt3ZrlkvQbjUQnWPTu5AMWd6C2 c3f95VrY3ZziHE/Wq3vM02R/fuhMeY74NdnNpplN/1kX4+/y9ZoZb7psOH0b+Mo2y8fL /G0kkyFzeewRg3MRNER+/Re9kDdOj2lzhqc5Be8/uLvwZuIOOXpvXSvBTmI2VLUttvxD N4SQ== X-Forwarded-Encrypted: i=1; AHgh+Rroae5MWLirxomikV7mUACsAQYcYpr0rmIIBURShemAm3dK+Hajq+zRuuCfH0US/cqlm0jLS1TNXiHCArQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3upNB2H84jmVC7DaCFnfi285D8uZv9S7d2rcIoJTO0jdPFe/0 e9EtxENq7dO0+kOtEmvrrHLQOHZY+PPvW0TFyFJRdNKX+9/vrlX4uketQJ15h4zaIdco7DRfGQt 48JRTpcvpFbaYGmzfWXkyACrWmzoqGtqhH3PtsE0aGPRY2h1u872jL4cnUqxqUCOept2xPKhs0y M= X-Gm-Gg: AfdE7ckBvf3mowa/a2zkFg5Yaapz2gDR+sbFPrEImEwXIuVlwWgqao7cUjt/3Nmjhq3 ncDQxOiGgAhdNpwxdLW3tLWAFh+7LgiluOJaSm5sO630Jk59UHGUNkzqNRHkJKYo1pdOm7gM8oi JEK+Nl728drNgtVNuH+2oRCXm1qlq4/nwFVkm6itb0yc3zYPa8hjhtJf/9GMyVm06mYVF336IFt Gjr34S72SSIsVXclM1rQWgyycvmy7KWhE3mUtIEcAKdUnbj65PQb51wBjYGxtW6gVt7OKuIQj5s ixLLEoXC8heI571Tb4DUHRb1jMQIGLqgiknjQxt0QEAzEGJnaAUAwNIs61kM2+oUqqCdui6Sjlz J3UAbt7TPWVwPSp2SjympHbJj1Xr8hkIkqwI= X-Received: by 2002:ac8:5dcb:0:b0:517:7277:9362 with SMTP id d75a77b69052e-51c8b3cc267mr28182191cf.48.1783521652514; Wed, 08 Jul 2026 07:40:52 -0700 (PDT) X-Received: by 2002:ac8:5dcb:0:b0:517:7277:9362 with SMTP id d75a77b69052e-51c8b3cc267mr28181791cf.48.1783521652032; Wed, 08 Jul 2026 07:40:52 -0700 (PDT) Received: from [127.0.1.1] ([178.197.223.174]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15da821c58sm52543766b.48.2026.07.08.07.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 07:40:50 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 08 Jul 2026 16:40:31 +0200 Subject: [PATCH v4 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: <20260708-dts-style-checker-v4-1-c175e6401150@oss.qualcomm.com> References: <20260708-dts-style-checker-v4-0-c175e6401150@oss.qualcomm.com> In-Reply-To: <20260708-dts-style-checker-v4-0-c175e6401150@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-Developer-Signature: v=1; a=openpgp-sha256; l=2896; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=G2bXd/eL1oQYJ0l760V735gooPZRhUjHojCT2I+xTys=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqTmFnkkhbzDmionuSIEQRDKoPgajxDRXyx4jNh PEhTbnWPOOJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCak5hZwAKCRDBN2bmhouD 17JPEACSFt5eDXfF1ViI60gaOrhaf/iF6tWtnk1iHV0tYytB9hYz1wYiqWpQCwxpIguno/trMj5 AlQqjb78z4ccp2si9Ecskma2lKzu2x8IS1f9zYdffuBZM7qQacKX5vupZvmnTp13WFwPPlNidHt tPMztfud5/sYiaiv9sWApBgXKKh/peVh38cXBGgLqj4OD4wJpCR3uPLhNyzJcRInmdjFC48IUYa gh7AeV8gs3etDD9RPXCLi32rD91UrJQXHncwnNNarPgzjCPpZsXBGojc+ozj8ru9vpuC5HiwcTe d7kO/6lGDg/fkXx5t2m/L8Wc0YWsHiRm/n48MIJ8MvA2tjtuZ0ZovzU5/hkUgT7W2HOha4QHCPg 42Oc8MAnGR4qHczqRdgGiaJkcFrycLzQyoILJvcobzORWAa6FeCcog0NCuiawmg7oWiThonsEw7 yEJ1e0oX18DeJ/dbUhXbtJFGiYsnIV5WpnQo4kTIyglTFKGglc6Umhxf8qguOec5Ik4NgyzAbGU H8YCsHwsheWdpSwUiyrTzsb6SFy3WMKdvVpyRVftGpcZ4s2ph2S46WcbdL2L3O/G1YtSqsiKRBZ TVGCQ+Bk4ManGR/iPSoO4pGPWyQxj3CluXjhYq2famq3WSl8cJfbzEHVT5wKk/vp+rUep/E4LGu 912gnqrU50N0+IQ== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX6jkHJBCVuLWO UiwyEppvNqxyrp0HFjN37dtvihv965V/V7bHSA836uurBjE3yBaj8Xh+NScs+H8JzjwVdAfKO1D xr1kPAmGT3l42WRHS6py8GNqq7ZtAqpTDi+qgYcZsmOpsYPmhxU+qBWlopEs4qQ3M/PK4aQqtf5 HENdsDOJA5kUtfUjEGB1Re0w1v5c9hHOzeKZ2jdiBRZq5D/XvCakgWyz4W6d86eM2qortSnH81N Hq/Qn9BKeqCaNKT9plyxGR0Gt9u8Hrnl5fJH2X5Aa3LCjp3A1tGd4phOMFfleSdSyMWuEtGW7GU ASyloB0tnJ/PmM1JR0Ed0S1ONbyNbLQSNmViIT5aQDVKQp77RkOxD3ooL1fPxPuYvINVR8h0hR5 5dL4e1tV6COQzEMKXdPaL3KKA88O7nXZiG1ybWNN1t9Wwwy0Jlg0S+PzTtAWCF36eNkR6L5aVV5 JIbGK5B4OAEavEyfQ2A== X-Proofpoint-GUID: tsFRhLuk2NvKrqUySWC6jz_E9YTnF_MB X-Authority-Analysis: v=2.4 cv=TMp1jVla c=1 sm=1 tr=0 ts=6a4e6175 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=N6niishs+lR9UBL1FN3Qrw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=V5pUajA8bHdET0NC2RYA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX9MpjHOlzCfVg mJFQpRzP0Y8C3aVoKeHvN/BIveU9p2vI82kvdRU5eK9lI32/7FOhZGRYr5VC2kLib7iycdm8TwV I/saYDCfUQtorNBXRuA1YF+3En/nDGc= X-Proofpoint-ORIG-GUID: tsFRhLuk2NvKrqUySWC6jz_E9YTnF_MB 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-08_02,2026-07-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 phishscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080144 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:11:27 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 E2A45299937 for ; Wed, 8 Jul 2026 14:40:56 +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=1783521658; cv=none; b=r/uf/IWPpdpB0KFc0Z5OLfD2nOMMy9g/vfttL08rziHdNyvdnM1sUu0JOMsXUriW8J3aHLNpk/8grDtaEX8M/2NQWXrJvuOcxEfDkCLLCOInVO7ZvnlYBOj8yppnXHSsQZLH24q82Sk84Ps4fR1IkN+m0pXaebs9IubG/skD1oc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783521658; c=relaxed/simple; bh=Uu69emYGs2xCa2QEFBGtCQhQgg/7WJY9mNOF4Qw6r5I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Mu/J9Rde0891ds4Nxk1mFWN/nKKfgEHjPrIyz4m1Rgwmloq6pSONm5yWIhk36Yq+f339qNXq/ZzS8ZDNlmuIr3XFw5PT6pMQu5XmnsTEUzI5x9KwxM3I2MjpFh/TO7FYA4c2tRhgoBHr4dnUYkUHvLmZ7vbhpHQCh8FOIbnLgNo= 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=hJ3jcTsW; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=StVLNTiW; 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="hJ3jcTsW"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="StVLNTiW" 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 668D84Jc2678773 for ; Wed, 8 Jul 2026 14:40:56 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= LR/1mT0vFj+AZwZXRMTrkGiU02iXu02QvuQHVO1OrI4=; b=hJ3jcTsWMmuMKXIm LoXTAnabt4UCStww32FZCW63c8wb84MKnw39mQx0t0Jhc9Spo/GkvDeIVZJiHl6m GZDWwCBpu1TNbdPbE+j4wXfuzNhikEecZee2TgPWiiaByIaV9HTBMJNqbW8iY5G/ vMGhhlPn5o097vRfdd6h9cNDHNhYJ5VN94oenNr4s8ZE71glEABJG+YoI3cTzHcA v5DlC4MDNHuLvJDoHMJfjySRJOzjR6xJfAhDMKUBrEXhT0u9gh/RXa3kcG32yxJ3 OdPn76U64ffgIOoQ91GnOJOLG/1xvgRLVe8HEmdSMUpSnQ93VJYcArpvVpDl7Huf FZCImg== 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 4f9q5s8e5v-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 14:40:56 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c1e6f602cso14979101cf.3 for ; Wed, 08 Jul 2026 07:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783521655; x=1784126455; 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=LR/1mT0vFj+AZwZXRMTrkGiU02iXu02QvuQHVO1OrI4=; b=StVLNTiWGjQWC3oFlq2QyDa8SW1tcSOnApAq9TkThblP76k3Fh3BWNAk5dxpFYu5xQ FDWwIzTK83SwwXB0K6vV7UgTXwMzb0uVzXp1R8/beWWVl6ekjP7MHpUijwXCkQJRRMi7 F9AyyKxWGmFm8hBQHbrMosf5F9otpPeXT809K4eKFi+TxFi6hlzZJ++lZxYfII2bibQC eTXvy9v3tJ93tdpwDkd5Sc7/vl/R9p9uXr9/cNYfJLEi6Q5tRrjxUgIUJm69JspG4wS/ XarWb9+l59fzmaefadaOw0XYLySSZwuizb8/w2buRwUPHUAaGwSqO1EAoxboCk3I2dmZ X37Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783521655; x=1784126455; 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=LR/1mT0vFj+AZwZXRMTrkGiU02iXu02QvuQHVO1OrI4=; b=RkVAelJyFBfXETPJ6027F3BgK7Rqz/UUf2LAPUFP9rImnYVs/r/sa+4H4i0viyzGPT EZuiLFenGz83JfIMDDgxB6NSK4YG7r71ZYLSvr+lS17y4USZGcUGrUoqaOjEeiSEvuzq umECzI6eghOq7SuspyZUpelMoota92be3UV08TdEXtL++z4HtMwVpJwgpAGFHlLL7Q6J 10czw12i0juA5m6ReeX568If3WJoPyd4Fx1quDST7SYzH50ViJEinyflmOKA3emX5nIB sIRQ3C2UHdTFshbwzbWpe48kcSV2rUvzdU1kU813wqZSgfmrJGjrw6qR65DW2Dzhxvc+ C3GQ== X-Forwarded-Encrypted: i=1; AHgh+RqggwsMHITqt6/Fy0KLNIhemCMjaoZqP9nonco2iZVuuMl3nTNbdfSTyUs4VKQcl7SHfTpjtt/A4kPBPT4=@vger.kernel.org X-Gm-Message-State: AOJu0Yxl1IhbGDvmPIS9TANVj6rQm1l4R1ohUt1+5dM+UUY82Hos5yom VozoxhzzOeVS9ul17UmEFUPbeI+X8hjEo1IRc52RJApMUGKneDRuRKiB1G6aYRrD+Qk+xzAvBdx qxvD4ZrRPBHJoVPojr1kpwNboQLVsVQiFYQ9ZxOwQxJ0kSd0GpnAeQu2FZs5RDaYFVUQ= X-Gm-Gg: AfdE7cm16BS72cD6MGux/yVLmHEaV+jMlA+rpMJYS/ANXKo4iyQ+H+b1su8WAHJCMRL IEzBLsQkrdG9aXLRKeCOwHTBPc1PqA7BL4f10jfatSaeSPjndUuN3nuDLDWxCQpWK9EEb6iOT4y 5IoVAUqZJHkeWayw6Cvd2W4CmNCNOpnP5aZ21cGPcfVOlHlJOuHedkwKOGLqTK3v2K0632X7X2/ kxTY0YzK3g4kP5hVuaa6XqfnINt8JxXQWQLkPewi88CL6RWzGitt0F64c+zys3EeYPpwtY0vt50 t723F6QMmladr2PYm5gPUIc2W9i3GSr7NSYrDYPOkmj5F/0QDOBWwftGysWixXzpZ4CsdiV+Tyg Up9T29XixGy2uRl+ZZsocQzzTW54HghAx4EU= X-Received: by 2002:ac8:5783:0:b0:51b:f40b:2fac with SMTP id d75a77b69052e-51c8b48f6fbmr30984541cf.50.1783521655024; Wed, 08 Jul 2026 07:40:55 -0700 (PDT) X-Received: by 2002:ac8:5783:0:b0:51b:f40b:2fac with SMTP id d75a77b69052e-51c8b48f6fbmr30984061cf.50.1783521654571; Wed, 08 Jul 2026 07:40:54 -0700 (PDT) Received: from [127.0.1.1] ([178.197.223.174]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15da821c58sm52543766b.48.2026.07.08.07.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 07:40:53 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 08 Jul 2026 16:40:32 +0200 Subject: [PATCH v4 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: <20260708-dts-style-checker-v4-2-c175e6401150@oss.qualcomm.com> References: <20260708-dts-style-checker-v4-0-c175e6401150@oss.qualcomm.com> In-Reply-To: <20260708-dts-style-checker-v4-0-c175e6401150@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-Developer-Signature: v=1; a=openpgp-sha256; l=4784; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=Uu69emYGs2xCa2QEFBGtCQhQgg/7WJY9mNOF4Qw6r5I=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqTmFoKu/5XIf8cCLIb849GOcGDe/3PiDQZ/5hG iSach+TfkCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCak5haAAKCRDBN2bmhouD 1//uD/0TkZ7aqZAMTOKFn8oFXb+r8+EKaxpMOS/Bavf6lbWivs+BbRKT1OMYaBs2PtDnGr8XmP6 fPuhOTgnM7loYCopx/cHk+eLqtWpRznApc6E6ydvqHwWj+n5zlJhR5SNaxf3PJz2L4G4WtJWdcG x9hL8PQ1URe05AjzY/v5qL7lwlsjfmIuipr8IzyQIQ9HobHCEH4KdUfomedR/pDn/gRsXWQWNtD 1oQr7KO7FpLSxOcR6fI4TZhslNuJRVdbcLPljh5HkOkpik7l1ZExxTNbV5wi2/dt6SfVBgITKi9 Ce09iaxOBLJ78he1bLHWUJptraaGzaoEpFtb0u9mjpuvwAnAR/iGToiPdffc3DLEZJmBAgRRg2t qunFFdZfiw1UDcaM6E7Ae1WUL/BHJVjFLWiULgeSIw22jJJ2lAfga1iMFbRQpxXUrtCvfjYrrXz vS+EItXt2rfnTpJyLhMORRK6x5T8jbfEveLY/kPghW2Wjq+TbPdyRxfwLuBl7FWxro/zzYdBejo 13Yk+/yZ+Q9tXqi4SO8mwyOUn9VKAlMdsFxQcS/RvRVh39YbUzJwOmThKk8FuOJ3/zQgX9ksOt+ qGZqMpFLa6EMJ0U1GkrmCOQlVgy5GVK/bKyc7Esk+lCNJRLE3zvP6fA0dTI9R6MeTiZIjuGnt0F s5b2bQ1jUTpx7Ww== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX5mPuDZUhlETK 4jo/eEjXphE4SmxUrWEOgB64ZAhWKub9Q+jwGYYqsExeUyoIwRPxuEIItvngXWnOIp5qu0kLTaQ 1sT/OhbKWNfbTaMkTQS0veVcldRClKwDbaov2WOfvSndQsTXnCMf3pIh9Ixrmcaik3V1n48t8de VX9SjKqmKFQ9IU2N6Bp/DBg2XsIBPE6EKt6Zb3Vhu/wvT0xA+LXeOLfwf3rLXkoRh8+sWPJZzMc A2Se4noYF08+lywrRGGx9ul9YYo+J4d8oqJb+7qdjws8yE/6PS3eiCW3ecfr/5Pi4HlPk2D8G8k cOWJv2Uef4eGsT6yOQtql/+N2b4g2615mSTllAYhw1LJt1wX8UDGEXN8BrSBn4H/pg5twvihwDP zdMGPK7JxITsSyZyqY4DfmZcoZbnIp9CUt2iX24iukfeR1DNLWrQi/ynnRCKnlDvtm6HcYmIzlo XkGoZU7Nt14PX31js+A== X-Proofpoint-ORIG-GUID: 0eThcQ2keDwYcoeEEFEYaRoD8fLbeavm X-Authority-Analysis: v=2.4 cv=NfTWEWD4 c=1 sm=1 tr=0 ts=6a4e6178 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=N6niishs+lR9UBL1FN3Qrw==: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=4QunWNA95kgjFIb9QjwA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfXw3PaWtEfrm3c IssrYkCb5LzI0ALlA9vvHplSc6X3ks+i+Xfr5Ppi9jRjQD/qqxhRgWmHZ4dK80zAkxoV3WeQQtx RyGb2l2WFwu7uTaI+20wiBB3qlg81uk= X-Proofpoint-GUID: 0eThcQ2keDwYcoeEEFEYaRoD8fLbeavm 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-08_02,2026-07-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 phishscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080144 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 | 9 ++++++--- .../dtc/dt-style-selftest/bad/dts-mixed-indent.dts | 20 ++++++++++++++++= ++++ .../expected/dts-mixed-indent.dts.txt | 8 ++++++++ .../expected/yaml-mixed-indent.yaml.txt | 1 - 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 29b25ecf15c6..5d7765f35ecb 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -359,14 +359,17 @@ 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)') =20 =20 def detect_indent_unit(ctx): @@ -932,7 +935,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..f0e40cfc910c --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts @@ -0,0 +1,20 @@ +// 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>; + 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..54ddf3608244 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt @@ -0,0 +1,8 @@ +# 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:18: [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:11:27 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 C5C6844D021 for ; Wed, 8 Jul 2026 14:40:59 +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=1783521661; cv=none; b=TC4r2po5IP3XpBKaU7d8bR1V0dZDfeHJ8Rs/b1BEljPSApaaDZkh0P3b8SFGNb9tJqHZ0g7vcn6FWW+gs0fA1lbaQftNp98/6mzD0U9TuwpLMZ3BQeAdc9YtLW0Z6B4b2y2J8egCJSqO2kBY7HNl/vfxA//9oBqA32ko6lqfnak= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783521661; c=relaxed/simple; bh=b+pp/0eMvXfKqo7wq9dHpWibqkFfwTyWma2wdSVnAxU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iSLdrEHUJ5irt7JPu/fzrmsvflM3QQUF29vczdmav4BT3cylubuTs9N0tjn9obdm1zUARVuko+Yhq9i5iDw+6RbglW59EMHv5ba1O+xdmbBD+1bAsN5M0S+MWCzDmXVUrZO1nhbOT83uPUEjZ0XMk3SGdqI1QxdVxVlszU2VMj4= 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=lukpCgP8; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Kz18lpZA; 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="lukpCgP8"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Kz18lpZA" 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 668D85sT2678788 for ; Wed, 8 Jul 2026 14:40:59 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= gnPPMZzj3Mrmv2RNnlqkr23EYkv16gUC6haf1k/aIks=; b=lukpCgP8h6w848RP xuIbaIhsVeXTjrTRbU0rrOQEldWko58SlhpUg0gMO/cp0dYP+TMDnex0ikb99azn 0SPoNUEhZ768Emh+wlq1WOe52MEr3i7O6pNGtKcyiXE1XQWFnqUi4e0CxTBZXHoX eC/nJUA5CizNp+97+ZYg1LX9nNymmvoSOaaCo9SlO3MpoTAxKvADeWrw9HKdLgBt ga1aD9j2D0hCq1iFQ56lvhamhdEu4snMaLmcrs90/pstwM2Cnf5icfA688JK5lny 8qVPD/p19M9hdyfSzv261LunVKRqRiC8Xk1ZtY10sg+r3NnD3hzvKQ8+nkujVn74 O5obbg== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f9q5s8e61-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 14:40:58 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-92e820609d9so76438185a.2 for ; Wed, 08 Jul 2026 07:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783521658; x=1784126458; 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=gnPPMZzj3Mrmv2RNnlqkr23EYkv16gUC6haf1k/aIks=; b=Kz18lpZA4YWtcZkW943RF1yZr3j+o8djrucWAG+fUSP+hj9YPO+gn4Vfa4lo5NNA+A lEKQHQQi8E2sqpXs2t3YKDSSrwXHT9HCd6SdooLMjebwqBf8vyQzuE/1YbUo1bZGegdp 9T6I2lDymuzf8rCbS+NyvrytcmacqHvQK0sxGJD0/C5bsV14scgCnWrgfxlbpBX8x+LI TMpmyZUzXmP3FLhM49wRshHvE7E+gKdEBVyGky2w/QLiQzCqaPaiA+0dhD1jac+6XOOO Pt8m0Ta7fo8AvodBAd1BiWblR39zuZu8i4h4mcdhTYqvlU/B4/OKCdVkqI7sN3nqW+iU scuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783521658; x=1784126458; 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=gnPPMZzj3Mrmv2RNnlqkr23EYkv16gUC6haf1k/aIks=; b=PCZqzQip6+/WC9qSNJuXC/FWGAD6p8ToIL/le+N3PTIu3w6vrwm6BIS9A5MAKFTdXk OkS9/ENTnL1nDojQrRNHt5ZZ2ilArNx+WjTymDWfVZxdb2z7SLiedXymrvUsWEWRRfQm YFjWdDLLOqdB8drQNq02KPJ4kAY5M77DwJUuxHIN3TZJ8trimqsIIwJ/nqDTxVGDhKeq BvsPTlI+Ai9jbh4vkuppU2CGcm9hecRzU4t57gGfYcDoa0nR3u/ZtL2Cni5q4MxR+tgG t5ortvBCcuoVZNEpPsU05e+WUP/IBXTcSFu5+taAFP2eJrOdtDUFp3JU22BfYL3coRQH RKxQ== X-Forwarded-Encrypted: i=1; AHgh+Ro/rCe7fU2uQEnH95+aHG04+O9mE0HlIGx3heueFmBJdlma+XdtewEtrClenfznsc8WuQT0kcH28phCjVM=@vger.kernel.org X-Gm-Message-State: AOJu0YzxfSqexBVyemy6/dHmxv7kRZy4TSCOhb9j1MbbfBnboN0GmAr8 qVmspvbctc7QYE56j5B8X9z5bBe1VUacAb8/5thSpA8XVh0lpGrPE+vdV20juvsqCkuFBChJ2CY mtU0lCS5pElvzanN4462YChjMTVT0pr5cCidOWoexe9myOpNPCgNR05JtxX3Upd5dpTs= X-Gm-Gg: AfdE7ck2ySAPAMBwHf0oQsk3V7bG6omaSerziuZ0iaoJUvxW3AcPNzKcm4yc54WfU2M kUXlMUQihOGNp0lQyy931aUgZ19gIv/i0fIP+YEQt+Y9Mg98dOsD/13E8eIeJOdubVT/6kejYEx CKMMfUt1Hl/01/c8SFQx4NtJ33cs7Ef4ZPzYnuNsmGLpL/1SujiwWQ75hAj/dY3jDWhA1K12cpW clSS8InyR6MNf26rALmlyUtlEonbsqOCIWqAO23QTePyc8z8tKcL7MiERMJAL7qCp0ur2427m0J 7M//Oi7BwyKvrQRAUIc8yusnfV2UCm7cRZDBfNkif1se/ZJkq7yGK6GHvXoQvl9VLhLnYAcpvs7 iYM+YUqrP+gJwSof8Eymqglhx9JloqpA8+LQ= X-Received: by 2002:a05:622a:15cc:b0:51c:7b12:5fe7 with SMTP id d75a77b69052e-51c8b42875emr28942471cf.83.1783521657650; Wed, 08 Jul 2026 07:40:57 -0700 (PDT) X-Received: by 2002:a05:622a:15cc:b0:51c:7b12:5fe7 with SMTP id d75a77b69052e-51c8b42875emr28942101cf.83.1783521657238; Wed, 08 Jul 2026 07:40:57 -0700 (PDT) Received: from [127.0.1.1] ([178.197.223.174]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15da821c58sm52543766b.48.2026.07.08.07.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 07:40:55 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 08 Jul 2026 16:40:33 +0200 Subject: [PATCH v4 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: <20260708-dts-style-checker-v4-3-c175e6401150@oss.qualcomm.com> References: <20260708-dts-style-checker-v4-0-c175e6401150@oss.qualcomm.com> In-Reply-To: <20260708-dts-style-checker-v4-0-c175e6401150@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-Developer-Signature: v=1; a=openpgp-sha256; l=3892; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=b+pp/0eMvXfKqo7wq9dHpWibqkFfwTyWma2wdSVnAxU=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqTmFppAlyyirSPtnnclYvhKQAS3wbKaDHmUF7X UqN2tDfkpOJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCak5haQAKCRDBN2bmhouD 11bGD/0bBHROobuiKuII92sQCYE7o2gOdN5s6p7mWjJQVhtm2sgR06E7BbgFfIkyLCnA6Y2Mp5i uolW5ikkYn7vDvM2CgKun2iS6DMY4/G3EiWjjQyP1w5XR+mmZ5daFmpQyDo/909rHUJnzVH7OCK x8quikCrvyj/gGWU6nKY8ksi6+mp5NsKFdx6Y2IKZjoMkAgpP6kqeqBy2dJF8WGtYmL82SYeI7Y zApy3NFNPK/emE3HfrCxj7pW4RQ2tIkzJlLCViuCKnnaEiKl3G5Zf6UpDYqrM8JB2xt54gOCysQ ZLsmmut77bgXRMhauKaTdPNqtHdVkibIhVYvl04slNKQD8mEYfLox0eZhzlUOR/nOzN/ANJ8IFD Dtc0+wnRZdfauBPQmOJdXTihYF3HdSZumdSFe2ec65JNVBQLnpOkgzVoSiLsCYE4o8KuUGAC5/U 1t/VAuXsFU4nfY2IUNqfEN6gZcJkg7aD2lnski27T9OpmEQfNJ5x4lLuJoaKB+TyA8vcfpSAqa3 oLwQgp7tDYrOMAj3/RoS75TDY3F8zCtDJ4U98SA/uR8mWtjYgO0IhIHnXM3iWk31ErwfyZ3ZlHk NNaQ07wP7X0XtqOMYKcg7HAeLRzMw51vUuWqUzwC/P+uJbhxIhS+ok6LkSzg8g10QAOY9C1Uu5c 7nW7Znc1XbCbemQ== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfXxUMliVg9vWWX 6TN9ZvEQ5Hwvp9EfLn2nTWGsv6NnSVXspje3+3X9LnhioBrp8ktGsb/VTjSWY/iYlATk+tJ4jNY BKrxhmt6CXq/SnL9VuiMVAvTvs7TKjEI7+M8wWwhgH7gM0El/L3YN6wuUr3SjhtEChlxwemxzvc zFOXlbPXrBJEEjkXwQe7DBlh33/qU1KrpRMuZijT/QIvZWmusyY/RbwRkrro2MnDi7ErfxCMHiD toF2ivjZjSrNxY6Lb//3KqodxRGRId5lR7chq6bWxP/qwTLIlKQTtvwSdWTR92V3pfpwI1KFoNN s2+VuPf/rnTkbTBmOgDGMWE5IRnVsM9YJd3NCqV9Mxznaj2teZxcY8F5mYZxGOy31ny7nzqJTPy n7IaiMVsP7T7WM6FVDxvOmc7f5h2Wd+R49YLPaVDuSgQvk8V9uG32Z5I77n1Zci8kYrq8IQEowD Rr122U0BLhOHU4J5E/Q== X-Proofpoint-ORIG-GUID: rFnGJEVCBsTiZFa8JPCY465PlbWhAsX1 X-Authority-Analysis: v=2.4 cv=NfTWEWD4 c=1 sm=1 tr=0 ts=6a4e617a cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=N6niishs+lR9UBL1FN3Qrw==: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=ZK4BJI6VOU2p3dBXLA4A:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX2TwJJzQl/8BL GVPKhzX04reIn/Us9YiD1vL2soraFX1WD3v1y5z81ZlRm5p228eHxyETjESSMh+dS3LugokQid3 /RJCdVRRIS45stmopxhAz9v/tCM05ko= X-Proofpoint-GUID: rFnGJEVCBsTiZFa8JPCY465PlbWhAsX1 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-08_02,2026-07-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 phishscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080144 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 5d7765f35ecb..bb9ec5b82319 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: @@ -420,7 +423,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) @@ -431,7 +434,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: @@ -1016,11 +1019,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: @@ -1100,17 +1103,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:11:27 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 3A206478868 for ; Wed, 8 Jul 2026 14:41:02 +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=1783521663; cv=none; b=NRAw7+e8CPyXqKyqQlKnvAVrz9zUOGxlmjJDiOtfy9SeGxBCkNd1aUqvmeer2Ib/Q8boCO5rvC02tJygPH3QwRoxSAaPa/BCBemKtDSevU5iSoRSwGqNjSq5ZPgmqNPIhVLL1B57FDNCAuHVliHLfLUeGMzQOnASTCEuryl2BMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783521663; c=relaxed/simple; bh=mvLf2VO5gkvRQA+OlmI770eNxRUlkZPnEmWKeYHyiQw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GuQHNhxxd7OX44fcD8wpwM8SOpHynkjZR2hIv6ZgIRTLTwv4vTIUFWzMSIj2+GvfwYYxo7OG7M/dkkzEO4ZsW21gNK1N4bnYIhvZDvrTTJDF6d3XW1SZcOa02ge/gwWJDsBbMqbPTF7daSBno+jez5r4MgyM7VKrO3uA8/h1wiY= 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=JJRRQOm0; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=F73f0U0G; 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="JJRRQOm0"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="F73f0U0G" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 668C3Crf2751118 for ; Wed, 8 Jul 2026 14:41:01 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= f1TnfJqS1AipREtUbwrb2yRIUV0zrh4oiQZqHC1Av7A=; b=JJRRQOm0ZCA+QvpU 6uAsaanw8mh3uZtMlVyJn1GtBsZgfGAQaf2WnF52L5Y7c5fw8rlEgRmxdmfFDqfm 7XrOn7BwMerNhFIUEEkRDBYQjbKEhkghr4YAXyrUyPvoo8fe5HxwCOKKbplss4dv oAIVzVFEInzx0JvIjVn6lYekHPeauks8mFP6Jwd2xv0Fjdu+w/ddc2dXg8nUpMd3 92GkPZWe2R4SIBKrkxGV1GCx+MFsOyZ+hk2EyMSqBl39am1vXer9tc/98PRaQDU3 4gFtjqEDqbFjF9VHVOjtnXFN1EM3Ps7Wv1h69Pi5vwrDrQpp/i2BY3KU4pNMFMRx CQT0Yw== 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 4f9g7hj77k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 14:41:01 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c21c01cf3so15917641cf.2 for ; Wed, 08 Jul 2026 07:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783521660; x=1784126460; 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=f1TnfJqS1AipREtUbwrb2yRIUV0zrh4oiQZqHC1Av7A=; b=F73f0U0G2O1o4AieR043VXN+3qLnQJzK53XtWbmNQJIuVqj6wEnBC9Jwj2MXM7y+jY h9eron6vnQRy8SqaVWdNBl6QZ6Fhm+rhoS6xcyrOWCyfxCCoJfBJdbDEyRacxOXkEMg8 u3Z3ct9k4iIiecErfg+ehdXc4vB6Ub5UfEEZGNtM82EiXzjTmoJy5GEf2tcEg4xF1W3y /bI3IctFSwNpbhQWguZxfV4znaVgnNp+8NY4mRnFPtVjEMB6eRpc+0KyXXl+wAxsweUR 2Nebzk5/TNRu/+MVB/XbB/8nyVXwiEIZqDDoSGz9oDYJT4jSVVYT0rTYx+I4uzZo3gFh MnXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783521660; x=1784126460; 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=f1TnfJqS1AipREtUbwrb2yRIUV0zrh4oiQZqHC1Av7A=; b=s5rniwHbeMKO06bRJHFohR6vyoOCL49zrgxwx25U/0yZ3GXo9dFY+smX0Lr97KNVKJ 40Voup+A6YlzQ4ZpNHS0fKxIhoQQpUbhj2B7IjuMbZRPQOToFNat5bpyJq3YdFIe1NGC 3nT9SSWXySPV62ffIYMs01aUENjMNVLV+PaU0Ur8c7HeA8v2EIrQQZOXRQTNn/zfsvrW zJ3uBRICl3MRsyvE0WS0aMBO6dexGrwcKSytlee1rTuNIhzs3oLEN6k8LqgBnrf8RBqg esQz6dyXda9dN0NidNWN3fhiNEHTLbR8xGog7R2cDa2T0uGqXckXuSte6EyqbegeTxYD E1DQ== X-Forwarded-Encrypted: i=1; AHgh+Rp3TDIlaJIyaBA0kfGo0kIvNbXovm3uP2SA0RvcQyt1EBFpPY3C8iAbARYg6jLizLszHhcudgO1LQSh+JU=@vger.kernel.org X-Gm-Message-State: AOJu0YxdBwU1Ty+PztYsvowIxvjoP4m30FMKqyoDE9PTvTjR4MAEazDE hPF/bqpfjj7OZiWWI6xU87A8YWAQj/WixQcU/WmFj/5QehB4+Xr8ai3p8XBVgcmiCC9x7QiM0DS YgiLiTP25x7RtuMFcF0qOch/RVWkJ9QTi9uxyi2iUf8no5GNP3S7pBTn5LZjAz8DIqxA= X-Gm-Gg: AfdE7cl+Sp6yRRbDSw9WRq5JDc9Nw+ZrnFpCLSGhq86NkOY8nw5AdY/RcVjzRMOuaYa jvx31H84CqaUJQTYhq6Xey/5qTkHCOi051+7pp/Q8V3i5/4czjPYuYRh1MQ9DU8Vbrm+d19oMN4 EwtnPDBf2JTT9A/CFwCcoiCWbdrCRztMlssiVpd9BDcZFg/QqE2eHzu83wdK3kBDPb3hRF2yC5R gfZewygdXSmhQN5yL0DfXum00OahhoLeh8Cn1eVn1yx2mV6RqMG2qjAd1LxB5IquNavN9K6Yvjz bFNE941Po1mxADCh70Jl7q4+5bZ7H6qG1X8T4ZeZwoCvC2Xhbrzu/ULKM2GbiiS7/P1HnIfFe8h wZFXpaL5IqUn0Ru+lec8hy4FkvJXoeYccCpg= X-Received: by 2002:ac8:59cd:0:b0:51c:257c:8166 with SMTP id d75a77b69052e-51c8b3d7022mr29593241cf.33.1783521660266; Wed, 08 Jul 2026 07:41:00 -0700 (PDT) X-Received: by 2002:ac8:59cd:0:b0:51c:257c:8166 with SMTP id d75a77b69052e-51c8b3d7022mr29592891cf.33.1783521659732; Wed, 08 Jul 2026 07:40:59 -0700 (PDT) Received: from [127.0.1.1] ([178.197.223.174]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15da821c58sm52543766b.48.2026.07.08.07.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 07:40:58 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 08 Jul 2026 16:40:34 +0200 Subject: [PATCH v4 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: <20260708-dts-style-checker-v4-4-c175e6401150@oss.qualcomm.com> References: <20260708-dts-style-checker-v4-0-c175e6401150@oss.qualcomm.com> In-Reply-To: <20260708-dts-style-checker-v4-0-c175e6401150@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-Developer-Signature: v=1; a=openpgp-sha256; l=8217; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=mvLf2VO5gkvRQA+OlmI770eNxRUlkZPnEmWKeYHyiQw=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqTmFqB+G46NBSeWVLZw7j1bMqMC791WUIUmPGg GS4LBZfvvWJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCak5hagAKCRDBN2bmhouD 13kZEACXtZJlcAqILS2uVZna8+JQ+h7JPfaEMzbQ2lqIHdO5C70J1ITOdmM+owYfONbTZ4oaRrp 3CTiqhgaQ4hhRAVBhFJBG1cIbWV+jWkNeP/bpKefcZf2C4fnsYFFyXCxj8bktMqNnbSUmf899Hb lACYD8Un3ZY70N8dQXBgvk+PUQsCEkIAP9geoKakEiM6qOVZ8adMixPUEddOYgIb1MSf5EXckzc uB77EgmzrVmTCCTUMjszjaL9GIntiEduiugL92fNuj05FKGNLj/j4jZGAr43JyOvrQmXMcGWRbZ 25YRMq/fiNq7iA/rdzR/o98q3MXSA6XUgrBbOtlqPewrAXvnqo7FGzmw7b9UQybDc3JVBCoBgR5 mUlmlAYlIhEq3BLwZqwUNr3Qw27syfnGak24pmAiFb5e/a4VGL1/a6pVOzzLMcoDcJRsPW6puV0 m1watz5E6RjwVFSK4x7b3plFKrlyLdrVvTClfm1UOMlPq8W4q6yXYc81rKmAaI3u/saGtVkY7v9 Ffavxae5I+XD6rZHdGMjf3gMea2Xafr6SdiOVSei5I4PKrDNf583ywzNEcfazpyfNzftnPMopTk izcdG83jUK0Lk7i8LMqXTm8ULkJZoeUawEVT8SVxdP003BIiY+a98hngZdj3sozaWCsW4DSLrWk NH6cIkjk5tjgmsA== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX4QFjqvg+yA9S YOKp0b69qi1Y2GrQ0ECAPLK7C+Vlpx/1WfMeCaaMSQN5a0OWR1cG8VDxZzrrkFqdxWDSijuN+Tj OuI7M258LAXyqhlMbLqeUjvogpOIxSWqeb3uRiQ3Q6FbiyF7raZgNWjXhtxkRMHHZXM5DlJ8fLv 49XgaDKV0cmgKLX6cNhDvAkuvYmvCyCOvm2Yduy8hQMjzS7fUWxilkE+vhRthdqEO0QgYR2aeOu aXLQfa68DDOCLf1eEwu8RIo7rEL9GhVumeVBILmrgL8IeFTTv6S2lKzJwiHaHrHbD8X+5cF8NhY f3l7ZwUJ6dXlxqMLSlwZgYMOrkYlkt3/2fdFMp2U5knpu72tjT3EX2lIG14DZkFiWP2dCitF2Pk kHSO/QIRZeKLEOCSQBKYrkGHacC/qza4Ky562qjHMptHNlostIBlvyZNb+E9Wh9ZU47BxzdpdDh DrTXWY9vEEq4h2+NHWg== X-Proofpoint-GUID: 1N2IKQkQk5EmL3yow0-2C6gkCzh2rvsB X-Authority-Analysis: v=2.4 cv=TMp1jVla c=1 sm=1 tr=0 ts=6a4e617d cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=N6niishs+lR9UBL1FN3Qrw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=A1X0JdhQAAAA:8 a=UikGyXCc1Zc6WlGwHegA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX/L0DzZHiI65K FfTV6o76mHhqXgN1BSeogD/Cl/pabOse5a1Ki3zquGx0ezw+1NP9SQpDSH5yIYHIgQX+lPdd+tY steEE8YWxCpkx19XwQufESROFgn3NUA= X-Proofpoint-ORIG-GUID: 1N2IKQkQk5EmL3yow0-2C6gkCzh2rvsB 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-08_02,2026-07-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 phishscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080144 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 | 29 ++++++++------- .../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, 147 insertions(+), 20 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 bb9ec5b82319..23cdfe78b189 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -558,28 +558,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 + 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 (compatible, reg, reg-names, ranges, status). 'standard' and 'vendor' return None for 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..433afb731dde --- /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 =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:11:27 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 832E2478E56 for ; Wed, 8 Jul 2026 14:41:04 +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=1783521665; cv=none; b=GMB3i37gNxMus1cR4shMT9bKpx17IO7bzWcOmapkpr0S8TzyCNvJv9ZuiUTDqo4ZqnHJun3nEPsiYT9lXrwEQV1zv9G6aI1kAK6Xlf/gf9HBsnT/Q1kTEnNuMH9QN2E9tMhWf+hmghrhjg3BMZ7xboiObkYUGjw3MYq3Y7FFNRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783521665; c=relaxed/simple; bh=SD35VSoy9JH4jlvZ8TVkyOPdLnzPfa9gl7cAJRc20jo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LvtAw0zzIBz6fRZp0RnCD3Gq3KScBlhS6ZY0awAeQYD6PuZ7gkuMymoSEEGUXuhFyQpHuQ6mymUt7HG03RTFq3CinnbN6aUB3pNFl9kWZoQIR6S1g6jybVP+Oeh8a4NyR1O969M9JK5G5BqmfL0ghJX3Z7ZxEDlnOLaRZmuGX7s= 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=W0dSveLy; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ACbnDbw0; 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="W0dSveLy"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ACbnDbw0" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 668C3In62607231 for ; Wed, 8 Jul 2026 14:41:04 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= dQpIebYENi+ihlciCMBZWU5as2aJEjk7DhaNcpj8ohA=; b=W0dSveLy6Ax4LQKd aIfB0pi/6NGkgC7YilRlrulXio5YjE+LF2UD1pbrY1yG12SpRPKYopEhEvmGLVK+ Pyp5FdINPsaWiA4kdodFb48237My7e62JSD3OggYyyIHoC7Y4H4ZlRWa8BIxbnyI eM4cLwyjV7s+prBCWWfZvwWdUnk7x1wS60ZBGQ9EdVmqk8DWpQznm/gsiIJcVOZW eKRGXUajnWX1WlWkqVGhrioezJLEmFdVmwsh+HSxOr1OIKt2fzmQMOJzjSZMed85 i79vlL4Cky2HIx2X8ni+s9Zkw+u0fb2NOffpXwKoLNhTozSLssq3qKoKPAIeNKpU sVQIbA== 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 4f9be5b68r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 14:41:03 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c0f0a0760so16940451cf.2 for ; Wed, 08 Jul 2026 07:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783521663; x=1784126463; 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=dQpIebYENi+ihlciCMBZWU5as2aJEjk7DhaNcpj8ohA=; b=ACbnDbw0xN1kO+D7CnO+XEiNQqMQWjdVanwMJt5eW59BGnmwErIeWmt6i1pzMao2S4 KMkC7NxCijxQlc2fXzz0KjyEpJGCxygvzI0bBc5+8T8f0z5kRWfQGkQYwaCMRigTr3DK HfAyT6ImoQeFEkwmAsixx4yKUPkrziDEDo2tAVgvTaUjJM6iRRH7LNISDuLwFvqTNaa7 aiXJt23FJBIsSw4w9yy/KQvvYtWur2yKjd2ZbZBaYUjkDiXb8aVd7cwyeacFS03canMP VyEv+Vg4BqFMRgNVjbXakCrUxNT8H+qnR/q065f4kSNdRO+6gk5t0PiX/KC4DwxIEyHe dwmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783521663; x=1784126463; 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=dQpIebYENi+ihlciCMBZWU5as2aJEjk7DhaNcpj8ohA=; b=qbYh/5Y8BMJz7yNflP6zR1+ygah9+p/KYnIF85PjyCNkQNX4daXZM0U8uE4Jru+8UW woTSlLclH1uUjqQTVYy4tvLxH4zbNRmAycfb1arKPVNcDKRrAKvdOOZMsZTK8z731PNw JiHxeLEJFJDSTtZi3zj7Q7s8NGv1prb/itoNvX1hyMSK9/h+9o940ycdXqxbyhQz23OD TTMfbEV8gF5F06WhkF3o3Bsjg1BWrUcBkOXPXfyankbYZ6fHiDgBmraU9dMMyjRPf+Tv rBg6FKCztqnyBt7A4DRAPr07VymTyrBMXHO1wL5LoBVVEXxveTKPH1MKv9sIRq56Bt8z dN7w== X-Forwarded-Encrypted: i=1; AHgh+RqCDE8vvWYUKGxm/wtED3MAlQZeWc0bkiKdV8LRzgFM1WQIrjLCVyVo6ukJ+Qrr0ZNbectTsbeSSb4iWxU=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/0nx2U/fdngBR+zBny2bjhEkfGNPLQaIprBu5bBkY0fC6o/aU MlAtfv6QZr5IbY29puPdBOLmkMVzhb3KrhITZVLfFOSgKNM1K6G7LoIK3La7DhyrzBFysZ/H8wq O6L7YCbYk3D6ltXWUL38RNpE5Is2boOt8DelfdFDZAGnanZ+zZjWQLHFRYaw7PhBnE9c= X-Gm-Gg: AfdE7cluk+E3Fvosjw07c+2lK5Vg4vuBzsFJkhC9GCNFfnOShHEVVvBK1idHrvirEaj dhXku4hJlgznR/JsBfxyT2XrzTx68ix8kAv84dewD3Lb7wtSJJxStFRvg220zXtoKJyfEYiKB6P gGRYFwvKK4PREgdO7rrys3DQzfUGbkmujpPBqpIt2iYDjBIMDb2bmIvqGGouFuBzKghaBsaOtRd V494K3wR0Xqp50Glu2uKKXx7bvXpRDpvdJkuaYEEPsVqYCcW15rsKNMHjeUvJ5gXA3bUfG7nnde Pkv13/AQh9SIi79kzUr4FtMbLXOuFOBd+F2LFwACXerh8H7TBrN8TAhSx4wrdB3/kiVLeP4XtaR 3A9fIdkLaIcm0+FoJ4O1iGeSbZ/2m/VbbJOc= X-Received: by 2002:a05:622a:144f:b0:517:9570:c1bd with SMTP id d75a77b69052e-51c8b3e2e1fmr28973141cf.25.1783521662849; Wed, 08 Jul 2026 07:41:02 -0700 (PDT) X-Received: by 2002:a05:622a:144f:b0:517:9570:c1bd with SMTP id d75a77b69052e-51c8b3e2e1fmr28972591cf.25.1783521662327; Wed, 08 Jul 2026 07:41:02 -0700 (PDT) Received: from [127.0.1.1] ([178.197.223.174]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15da821c58sm52543766b.48.2026.07.08.07.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 07:41:01 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 08 Jul 2026 16:40:35 +0200 Subject: [PATCH v4 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: <20260708-dts-style-checker-v4-5-c175e6401150@oss.qualcomm.com> References: <20260708-dts-style-checker-v4-0-c175e6401150@oss.qualcomm.com> In-Reply-To: <20260708-dts-style-checker-v4-0-c175e6401150@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-Developer-Signature: v=1; a=openpgp-sha256; l=4497; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=SD35VSoy9JH4jlvZ8TVkyOPdLnzPfa9gl7cAJRc20jo=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqTmFr/ATYn845lbBe9AGXNhkrhN7DIBNdfMHmv ecFVrVqZLSJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCak5hawAKCRDBN2bmhouD 12WOD/47xK+MgyamBz8oAceZB7ai8jru9TZqHWOAuiOM8lR+BKG330nF7K2rZNGYEeRbtDDPx5B TRNrFQFMtSdGDdk2HOBCK1/UiiOacDWLvk+khDvk1i5etm+2KuTpt3F/X5ROfhTsmiCMed8FCA6 SOretcmayRCztQg7TYBfD1RMvU72bWq95fi85ljJft++jdhp0wO9ZcgBO3gFFLaaGVINn6e5Uo+ BnsEZetSEwG32Jec4Lu2jaUeGLGLt4RcxcjEBWTJu9sjynQKN79Z20ScCFrkfb4XnV3egAOGa/a rC6cqQIiJIAXvI+xP/KK/ojamN40PDGG6WR/QK49XbnPvLEm3GjJc2JJvKTtZbTmsPfjBhxc89T EZcmlEGvzaYt74dehoq1/P/svGvWm9AqjqJT2P78ix/pxHIWUHELn9cpm2JHFzjNj3tE6mgEPfQ uzaoGGuxH4T8pJUsEdLi6gBzSi4xft15nJdQKhPEgpwTYponOIvUVfDplFVTudHyeadBU0U5DCL JOn8INHnJPujjiizKbSLjXf0qoUqnf92VlY3k1jnffODVJq46LOdAGYYM/020pxf3JuOvpA6BZB CjImJlmCDCUxn6CcFAJNwc/3jQGKivWeWSyMIzFyiHkzkYJq22AvlNbOMwok11qs2H+2f6bN2cx vBGiOlhzG6T9iHw== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Authority-Analysis: v=2.4 cv=GJc41ONK c=1 sm=1 tr=0 ts=6a4e617f cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=N6niishs+lR9UBL1FN3Qrw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=0y9rCkXEhHseLPfnHlwA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX8iI/lty1xyu3 L9R4mee4s7+iwmRLDwzUiNXZgst+Wu5pI178RJ8jwQoMzPn09sG4s94W1pThqo3OcHPO4FzkqNP 58vP+X/H5JPEntPkPixr5M/U8F0EELE= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX81fh6u0NS1Xt hDbm5X9gYsgadHUVfuCSsRYYh/vaGOr8J+vsC56NrVQWVAFkg3MdDAmSgYkXAJZmh/pCbuBjOsE Wx2AlqFXAWdKx7nlXDWPiK/GlxkFQPNuPErn47Leb81M2frBpqMii1a7txsVPMwlqY1Aw/154zP pPsXEHw6TTBQ/1Ic2OVV+0I6lqD0jTF2ZB6xNCBAHWs7EnTHDlNVijp3HYyeKBv4z9eFExKP7aM 274Zv/0EW1rWw69bKW10IEDI/cVGNU5IZc+3X4iWsMWwVTZrbeZqob2ZHi79CUv3mkXIGcOVAQ7 nu1SIJoj/c7fwJqVozOtpTtlOMO60U4ZPmCsWHspQEfoGel0RdqNxiiYMeXfcaRn1ZX6NbN21ZH pwPAoVMnZooyWjcCxOghk7dPIpoAatIOfruvE1FDaDhX7N2OEoqFguciJ57lT9N9qS++oCt1F9B bRwtR5GSerNSP9+Dwtg== X-Proofpoint-ORIG-GUID: ekXsCfGZOHvE70-1QGskhYOug7_w8OMY X-Proofpoint-GUID: ekXsCfGZOHvE70-1QGskhYOug7_w8OMY 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-08_02,2026-07-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 impostorscore=0 adultscore=0 bulkscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080144 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 23cdfe78b189..9a5263a30663 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:11:27 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 0661447A0B7 for ; Wed, 8 Jul 2026 14:41:06 +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=1783521668; cv=none; b=FCdSHTpdKXpEFLGKyW3YTRH2LTQGh8YP3N/9KbfwFHvuTaITeYOd4i2kNCR2Dy/MYeGh/RRWx/6vHjI2EncN5e9odvJ7cDggBvFAvPKkFI3ceruQCkMSBO6cWc84BIC0Y/69n0b53xLkZwmEJjF5tV/gjBU3u9z+/wiqeDbf6CQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783521668; c=relaxed/simple; bh=tubZzguL+WhV27foJbHxv2tvacR/v4H8iT/wG+L14fQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TT2vpyxoGlovdR3770LZcU0Fa2ZytHjfW/5tdqSkHz3Go5qs7ljsnEc6jkoIt0vVTA7OvEM41B4P56HNXtk8nmpBzdGzTnrUUeJZEqDuMlUHPVRwVY5I8ZEKKaNS/da9mlJQUJqb9NXGGdSVk5wdQ0pKwdWheH3IMIIA06OG0Lg= 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=axdkQMAI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Nm1cKZ5X; 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="axdkQMAI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Nm1cKZ5X" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 668C3JTg2666207 for ; Wed, 8 Jul 2026 14:41:06 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= qok6NGQ/qJpHcjWeRsahVyAkUCO3bYjcuHXJFMe21tg=; b=axdkQMAIO46M5UEF TYy2w30LO++wd46Tf9IQIjizIXdIR5fUYYRMsLOJdEY0avnqge3/kwKxKvHMtFyG aFQ82fxmi8EVfvaqHgsbdx1Zef692nsq9FicgpB9QT2MLiBQMFXWjr24KdUUgKc6 JTZ2P84hAqtHJIxzZWVo5LFc8zQsq0OHznt2sEEX13rJZe2C3871MvQHhFSwoyKV SmUoriU55X9YNljtC1o1pfMHqsPIj4r//Plbr4EWHoEMuPmOXbBsh9GSTbFIKkbW IYXfT/zKEawhzihKAXkO6Q/Ph1G1+0qC/ZVQrSsT5uy+xRUAdpgfQjl2eBa9VlfV bekkxg== 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 4f99hgunyu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 14:41:05 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51bec738909so6380531cf.1 for ; Wed, 08 Jul 2026 07:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783521665; x=1784126465; 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=qok6NGQ/qJpHcjWeRsahVyAkUCO3bYjcuHXJFMe21tg=; b=Nm1cKZ5XkgpFASKutHijPuSBI5vRpEJ+veE2hYILMiZS8S3z1dEsnJgpGdbHYNdHYw Kih+b2MS8rEHrfeN0i/yzhtaiTJihwcUb7rbACBAQN6JycZd48tTeVOvHQ9bXdjAqCtg dTuNyjxmXlDn1yi2hdisa9GxXzL9LOEIq6Spqp1XyDHDXwjgbzV51i+MHJ7M/h5Fp01d VXi9306IIjwHXuLZ+vAOSM0zmOJ6g/HmCc48e5RA8aJTQKaFQhbNFsk8Bi4Pm/5BZqCN fgUIMIxD43nd1t0wYdxUpanK5BqlCECpXfDMcEJClBa9IesfncwqHn9xtN15A4nliiA9 RXyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783521665; x=1784126465; 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=qok6NGQ/qJpHcjWeRsahVyAkUCO3bYjcuHXJFMe21tg=; b=QV8yNxQ8swvr7T74n0WdH4Cy4tJUtK+BrKuKrbLorL6/tFzzK9xnmBk9X2Zi1AGRfP Fc7ezWFQ6zrsE8B37P7nX48qtTzDh68ELvh2qA7DaqqcriSltU3xiXY/eUb7zLUKLdAz Rzf6sSjYz5zggqTm8QoOvDfKZKyNCZnJKOm5iMMLCj/sTo6UWHzBLCgT7hZ7oz0urkwW CEeYoNhWCHGRmbXg9xPDQGGZRfHOjC07WFNk1peizfOYnsMCjvZ2UzJz+OZJcoGJNsG+ WGF0vUCq1PdhXfgrTcNb66NZSXjUl9W0IzYIrNRzofaq9rg1L5VNg58weoLa3PXP8faW VHRA== X-Forwarded-Encrypted: i=1; AHgh+RrxOqLo8C5Ya6JMe5rU97nL+22lEbhgB60owLmeVWnClhUkx1MquoscNWQGXJLYiNFMuh7bNpcS10X3UEY=@vger.kernel.org X-Gm-Message-State: AOJu0YwDqd14l7gkE0UUW9jgeXVkvg3cTJMUoU7UNdrX4Guk7zecAf4p 74+TVi4eDb7yLrPvm6BEFPx5ee8+5ajxKYosEvNJOgxcSiR15+WxCar0tvn1b/D3MSJxZSH+Kak ndGvr0l5S5iwgGi0blWk6IV+vu4SOV3T4FbhLDFIUbbwHWB0m7hDxgJAoRBKpPRCEJxU= X-Gm-Gg: AfdE7cmCYBehu4hThQWaIXBI4F6zHnsKhlwRSFUBZhIoNZjaayl8WFXPa2u41WqWnOr 9+4wXxT64Y62teCkKkuUKCkJHAWedfSyNz+cfP4zKa7JzSWvfDpgU1RXAU6qnAL1Jslc5GyoMaS 1SIPuCnW/ArTSHdPkTkBHHMTXMrsFiMkPRK8LhBcqkIJyUwinucG1IYNaqu77CveGhcSaHMgkBA GOO0jvlSwNqKaaS9q6s1/F9+zqcOteqpx9nl7YknXgRCve+J6KJrZ/S+oSs914D7qdtDuK9iM5I oHZ80Zx8kLJUjG0S9bo46hRa4wAQ6Oo1BR+8n5f5FT93YgByh/NyA1rV11vzathrXdrZ/If4A5C WTbo4JPcMktacsyAww5f0V7viahuc59KQtiU= X-Received: by 2002:a05:622a:11ce:b0:51c:7e12:bf58 with SMTP id d75a77b69052e-51c8b3b5905mr28410791cf.48.1783521664932; Wed, 08 Jul 2026 07:41:04 -0700 (PDT) X-Received: by 2002:a05:622a:11ce:b0:51c:7e12:bf58 with SMTP id d75a77b69052e-51c8b3b5905mr28410331cf.48.1783521664488; Wed, 08 Jul 2026 07:41:04 -0700 (PDT) Received: from [127.0.1.1] ([178.197.223.174]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15da821c58sm52543766b.48.2026.07.08.07.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 07:41:03 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 08 Jul 2026 16:40:36 +0200 Subject: [PATCH v4 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: <20260708-dts-style-checker-v4-6-c175e6401150@oss.qualcomm.com> References: <20260708-dts-style-checker-v4-0-c175e6401150@oss.qualcomm.com> In-Reply-To: <20260708-dts-style-checker-v4-0-c175e6401150@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-Developer-Signature: v=1; a=openpgp-sha256; l=4041; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=tubZzguL+WhV27foJbHxv2tvacR/v4H8iT/wG+L14fQ=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqTmFrEnhjCUTpy3dsYlWg/R1MZ3ISWDy79pnEv VUfDGrY7Y6JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCak5hawAKCRDBN2bmhouD 14BlD/9JlEck4aFElc5T6teC9AQVJGHmw22JzhOgHgwVmGDuC3hAFZZ3QwZet9t4vWg8EENlraI LQC8KwEJ5v7Tf/S2/7QCEa92OuVRr8j9ipWajUZ6+daWDinZsSUr8wBXqA2Gdp/pPZKsZA3XILg /aMEMqD1uJVprh31x0m4jSDhpQzY8ObkREf/YL5DiHpzMHxGQpCchHvj4xboaSmLivvojZLQgzr 2RIX6dT7lXpRbPpZJnH2oA/XMOGcwd67qJcrmbFfwJmQmx3bbprDkKRo+2mgUyKXNowOEC8XKtf 71IirR09gK3GM8/eMZ01jutTlPS7dGUk0VKxSpH7xVOjgD2pqxRJ/tZoMjNvA7NkcXRnS2lx4jx BQd9FlOguYCaHAb2NO0Juh68/QZeDF1A3+MtP16UjgGStjDcA2LrBqb4LwvzFSojMNwetySOhNT DIOyZDKahrc2xyYnJL/KEF0FxjmF8EVqV+VZnFY126vP6fPjJlOGvcHBg4oKj6UGa+ugQDX3Rm1 gafLZI2i84LwdmDK3tjaJvgKmo2NZs7CXE2UZFrAUe3Wat6FVJIVTvHAzsQuBAWkP5Rzu2PlWPR f2JoKWFBzMYDHb1vMwqtGq7lQP1aiGQepqOxHgt3kRu23QizHI6FQXBT1llflkRYS4pAndBsWvF OGb3mho+pkxa0Zg== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-GUID: uu8nIy0cBHMN7n2fECyfevSQWsmI8Uqt X-Authority-Analysis: v=2.4 cv=CviPtH4D c=1 sm=1 tr=0 ts=6a4e6181 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=N6niishs+lR9UBL1FN3Qrw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=eNj6vmoAg1EGTkcKitEA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-ORIG-GUID: uu8nIy0cBHMN7n2fECyfevSQWsmI8Uqt X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX0g3XijO/P/1s Aoem1sLxveNj+jD1fGXKn0O73PSsJBYhDSwOOAIuS15LvpG4yMYdZc4A83RrK0t9kAy2M2oziRW maTQxDAYxZgvfpMzzywFNZXJzbQp1AY= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfXxp3RDVWwerLJ t9S11pFXQG76OjF76qlUqIuAlmiZwT4R1Ig0g0+B6gx2Hj5uh0F1sWl4eKznR01q+BzBSssklWG Ks874wBbRiHxd+ukGjiOGhMoq8Kyo/iYVbnti2FbLakqpQWdGUQUUBTr5u2J/C+qrFmCIbb1iSY Ib6JV8UDSKd11W0J4MMbSDet5JWr0527bFiAWwbbDpdywN/Wt43Bvv+8lY/ErWVgctuChEA2dQx g8L5d0AZlSL6WUboZdSUFqHkj2FA7OXcC0WphhfZ9cMaqareEzGyo0S0w6pusLJzArKBwH+fOFV hVjrV9u3Z4A4jitF9joScx82uw1tSa5p2eTUOSVecg0cmws+h0BfGcxCsQWQaOOnsca5wldDbn9 jYb2mbIJD9lC3wwGCvkrnr8NyvEcrsLFAMNNAiBGN/nhnkIJyyunHIvACP6Q8vD9zzvZdpEV8Y2 tQ/SCnDkS9p2oIp51EQ== 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-08_02,2026-07-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 phishscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080144 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 | 24 +++++++++++-------= ---- .../dt-style-selftest/expected/dts-spaces.dts.txt | 2 +- .../expected/yaml-indent-strict.yaml.txt | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 9a5263a30663..df056e4d0a5b 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -397,48 +397,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:11:27 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 2DB6A480DC5 for ; Wed, 8 Jul 2026 14:41:10 +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=1783521672; cv=none; b=PfNJZv7Z/JTC5W/xrgm6z/z0ZRPcOrQ+TnyO6B/IMj+sXJN6Va5EzbWCcgBwfLQA4+4/bZrY7GwM5H9tm5n8O8zb+SpT9WVDQnUhuaPi0bBusgz5e/m04+3JLvZLsznsRC1cCRpic8K84eSEmUWB8eAzrWhGFk2B6/yDg/h01k8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783521672; c=relaxed/simple; bh=oEciikgwfKk8PZpOdBD5mQPOWN8GirNRJb3GdeBjJpc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ae87YuqGhfFSEHyDfbcQvOm9ovBMNuolJJgB03I9O7aqViUdiKJDjXO8n2zr9Z3n7QAl3G01i51f7cWI2gVaG4HiDWrG7kyjmD9b75ZFkekrYPRBxg/ykCabmWGgb/V0g5x70vHJxoVjyENT7nedlSIU0vk1w7YJrzksnFXM2Wc= 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=DU2hyjFn; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UvkwJs+G; 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="DU2hyjFn"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UvkwJs+G" 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 668D84Jg2678773 for ; Wed, 8 Jul 2026 14:41:09 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= EIsaM2iM+QFFvxSTR5G/fTbUr55ZVo2ZYQHMqRV9tw4=; b=DU2hyjFnfi9N99ee LET8blG2zEGx3W62eiABagN194jT9K9LCfQAw4jbuliSLbkVXpJ1ifH4eFv0ZHLZ X4CmIke5Pd5SizFd8p0SmRvENcY08El5pcDrvNVSYFGzyO+V08t69M+iSj769uDW JBIysa6vvBO+lXRrybGVFZ854oMMtBkkfnSiMQEXsG5UNOSq0nXawhaUTUi3s1Kk dCcm+N0hWLUTJfyDl3FjHUWWXaiIY6FvS/OvAKFwy72QMG4yOLEVVOZ05V+AQXHk auJqpVtKzHATtb7yS/vFrTrZdmXb2/79rOEQkrdKmTqYlrX8G6zLEAIR+1mjQa87 2o9E/A== 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 4f9q5s8e6w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 14:41:09 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-51c1a9764f0so10012251cf.1 for ; Wed, 08 Jul 2026 07:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783521668; x=1784126468; 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=EIsaM2iM+QFFvxSTR5G/fTbUr55ZVo2ZYQHMqRV9tw4=; b=UvkwJs+GriT3Pg/S8pzUkZSrD/ZoycPf+iaAm86MVCLoPd/nacxEujVbdNr0/Lt2Tk YjJNw555TH9qnYYqZUJF4AmgKMN/iRyGNPu/Mwtet5yCbNlXYo3Jxbpfj86wtkvlhYVs W2J/49/1urWkZiAuL8G1Ion2B4lhrAv8a2g3u7fKmojvQqoyNIcQ3987G4lWH86W31hH p81hZPI8bcb+V2grb8v6jJG7aA6R7d4tfqhdGT8M2gerxzm3vmi4u1iim6J+KdSic6Is Q3+bV82v7knZQveETTxqQ2iRFIiu3UOXuT1QBb9O9E84o+dLUDALO5OyaObyagiY0rFC Qrpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783521668; x=1784126468; 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=EIsaM2iM+QFFvxSTR5G/fTbUr55ZVo2ZYQHMqRV9tw4=; b=Lr9w7YOUCX5lJTpH+DthhARpSjYbwF//JptEfguOjvU5B3Qcngaz1kBYxei53oen7g 43Mv9zsVX+XwoW58NRsWWv2dIyfhEZ6LGvTfEBfdtEtL+H8xNBOHM3q0q77L4JH95P/o EoeW+t6iaZ3ZFw+yhr5gmHsJahPLJDF2T72ir7zeQEivY5kydOJ+WcAqgYmsAhR9J9mK 1EjWs+wQOuSe4fRy5byTAiQ2I4T2uhwY8qXHrsQ0mU1g2hDB31IBIJoExjcAQD5TH/qF EWEdzRlevihnhiZPEHbBoe82BFMSxwh++xxBm6nE740c1QTTsLYRnKTU+n3wF3fy2rzE 5zIA== X-Forwarded-Encrypted: i=1; AHgh+RpWCU16WqxeBfm3q5eYYBu6aV2EnrB2Z86ImtGSW/lIPV64tjATVaHq5GoqeCa8Eg2s3oK8eA92s61Nn9M=@vger.kernel.org X-Gm-Message-State: AOJu0YzcZ3N3Rp3kU0gatLj3+/gmBtnm4Av5H2Lt77YRaaiG2U0O1S/1 zhJJIfYkSdazB1dHi7Lqbmuq1f+dovNtRiiRABIQRgmo+0w6Q2uCtr+h1uHsHv6SJHKCWgHsm0G CtHPksRsoEHJJ/e5J0pkCnnh3gy3q/DIUhTd2ODPuax1fVMudPRWvonhduBSxKX8Sgsg= X-Gm-Gg: AfdE7clalTwk6fm09juE09vJNEyoy9l1CvZcje62ngWtWAQoCgTHqq1wsDe8tSufs2Y dJdPPj2QxACE8Bhre+52bXMccvaMBecniT//vYvncwqVGo0fz1UwvOSus8mhEcohmvHH23lSERd X2XxLdtXCJu7qeBIjMYyENRCDgGNAfq1nT9r3WlzQRO147L/9kBtnbAjOrF+CDQ/g1Oy26BfNDu jzkSewVbvr9gC/4i4LIeFEq04Qzv9G6ldvr33XXbH0Elw5GGMJSQL+f2r1d8r8lh9Oq0qbZEv+I 3tm8936smmrkbQry0+AdvhVJqQo23oX6wABUKhoisOPukMyuOp9E3MW0vX1ix3MqfvITiAjwlLS 2sv5DO5fXNxteOzkitJFtu0i7PVbuV1NZhdA= X-Received: by 2002:a05:622a:410d:b0:51b:ff78:f221 with SMTP id d75a77b69052e-51c8b2f174dmr30705701cf.29.1783521668200; Wed, 08 Jul 2026 07:41:08 -0700 (PDT) X-Received: by 2002:a05:622a:410d:b0:51b:ff78:f221 with SMTP id d75a77b69052e-51c8b2f174dmr30705161cf.29.1783521667669; Wed, 08 Jul 2026 07:41:07 -0700 (PDT) Received: from [127.0.1.1] ([178.197.223.174]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15da821c58sm52543766b.48.2026.07.08.07.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 07:41:05 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 08 Jul 2026 16:40:37 +0200 Subject: [PATCH v4 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: <20260708-dts-style-checker-v4-7-c175e6401150@oss.qualcomm.com> References: <20260708-dts-style-checker-v4-0-c175e6401150@oss.qualcomm.com> In-Reply-To: <20260708-dts-style-checker-v4-0-c175e6401150@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-Developer-Signature: v=1; a=openpgp-sha256; l=8467; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=oEciikgwfKk8PZpOdBD5mQPOWN8GirNRJb3GdeBjJpc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqTmFsJXZjGjMybuMGVt/qNOiCkpAD5e+oC5tpJ ioBCSRpkA+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCak5hbAAKCRDBN2bmhouD 1xwzD/4t5jU10OFIrs6+9VqvEUOdiuscWQX5iGzxYUwF+YHNzXa31ExQ+of3hiCzLXtp8w6SBcq DSe+OqBpUq7btzbkV+SRWujhXTOxFiXgPN/SuTHHGnXq5iyzxHLRxkl61KNqFtDMJPb0Wiz7yEU GCP02IHHqYUHA6Qe6yljdEXhwphRlMK5gcd9IJ1QOc25OjQWshqPz8Txy0r5bJjd4HFAr48nqG9 fed5o/mAzlCUB4aqnDvgff+NEjUDiYlL6ScgKIHlDnwWdukDliV4ORLCdxM1jH5U4tW5uzAewgc +KUipZKq35KXsnQD5EgSgAnp78wh39pJ3J8mO9gMjXZG+7jG99timpbUZAZGHbv9FgcRbdr5kuk CTn3c7NMRTCFpaKY1m9QTFZWIXpgJ/4zL7rf8ekAB8suOF0MhMDAUw+vyB0w9arOuBLYzlYhxfz z5df/6kVJ+r/0AiInqwOO9LnJ3H1BGgfDPF1bh9gGdSySo+Wj7fu4tI1n+1MeG7cBf4ud4tUmLw E41nJXcy7UYaUJXVlBX6RzeGGWjUwfFebXyL3zzA/oUUbVvzszZVm7eIT5A7TmFEWwDNeieTEae YHSrE9Tna256FGgccILZMBin8YdbiuO5l7+1l5tafV0cJFYee5sUML4ktMj1Z1HLqinvjkdiV33 lq45D4QLyVhuxGw== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfX0RdY2xjkGF/S C5w2C6qumRRbHPyOnT6I2g5YKjba7pO8X/xwIaKAdB8RZxeBAtRTsT2rhw2gba2dKwH7OqFmFzH ZLUE0kRH9WXH+h8WsSSCzF7HcU+IWEz7K2p7HqEmojntJNPahmK7DF0vhszIP8Qj4JDij75vQ6h 6KTl5LxlWGyhF0uaOTmln6utvpp3qQXfEJh5TEOlTmaz43vh+rufO4ykEkgeSaTRzjiDahO0pyp V3TiQP2Ho+XfSiXvwgc7H2tZIweKxMOSWh5h2pzYJx3upeEtqMlHtZwoD8GHpl/eGQ1KUyg0e1g HaAEE7BJ3pICoT1d9xn2iCEDzRT4pjN96/AT0TM4HmylF2EKmzmo26L+JasqjTW+vWzCfxkA4Lp TZrKUqACtyXYtt59LS46xX8QamwB62NRDDoPT+1OyzA7Y3UGMl40hYoT3ZALn1MjokOJbmCGad/ e7RWevYmnd19KUPDtpg== X-Proofpoint-ORIG-GUID: glwRkUHbX-5w0xHGsMNYQyLp3KGacr0l X-Authority-Analysis: v=2.4 cv=NfTWEWD4 c=1 sm=1 tr=0 ts=6a4e6185 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=N6niishs+lR9UBL1FN3Qrw==: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=SSRPy7KZV2plhviXFSUA:9 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDE0NCBTYWx0ZWRfXyL6B18057Fn+ vpEeDgsxHOYz76+8hMEuXxKYpk+6JHELz7jfMirujR1/vjM0tsoAZaR0Ok0b/t2rNamMVjQCV6I x0pKAjSn7PjlrxWCHGdP8SvY9L55GkI= X-Proofpoint-GUID: glwRkUHbX-5w0xHGsMNYQyLp3KGacr0l 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-08_02,2026-07-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 phishscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080144 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..dffc81cffbeb --- /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..19fb800e719f --- /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..66547a1cd2b5 --- /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..b1032885ad48 --- /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..33ce562b72a3 --- /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..d9f1f533beeb --- /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