From nobody Fri Sep 25 19:20:29 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 D1A8055C1C5 for ; Wed, 9 Sep 2026 13:10:53 +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=1788959455; cv=none; b=h5R49W0qgWX6YRuNUWjPZIgEbxZ0eKGfaMbvaos8WfL97w1DbrgjX0/IOv3Pn3N9VZQ2ac9qx2ZnwA35tR7plCzUf+DlqZtgvSP3ueJCo8wW8okNCyUkxTw7XIOF16jvZD84M8YE23ahUWuF0M3A67R+72o219qWtKkMB3brOdk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788959455; c=relaxed/simple; bh=RpsFWGOJ/fmrFBjXtNLPVOkO7viH6czPpMx9xQdFNUs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CjEtPFXnzXw3g05cbbBs8m15rDvmk8ewaZW0MGM0JDnSGQ1V8XZU6ShKYt5F7JfdD9IVd4pkCNqVHIvlpDEpEbIe6bY8PcdBQlF1qOnG046S9VHKLoPdsxuI7+JL+ssyuKPw8ZHk2OxAy5r2YIyGFrqrRp0ejxFWVjr1/uatY8E= 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=GsX90+vQ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=jTh8gmmH; 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="GsX90+vQ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="jTh8gmmH" 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 689BU6tO599819 for ; Wed, 9 Sep 2026 13:10: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= hOiYjCn1nD7fLf7vrzvPOq3oVs5fH9mikkYiajsOtfs=; b=GsX90+vQgNeqZyYT +9SmXGdRPw1ydqlxMOA11/b9kXzdBwqWjeDuKpkBDgfPJIkANLJeS/0QzwttE6v8 fFRZyQCQdueriBqQpHcGv+7C3/vHxFdszhU1Nw5nISpT7auHui7algIavcZD18Bk sSozE7RC3QV2mFhfb+fNMzidMsP3inx2u6QqNck1rMPVAv5e3RR9KH4GGFV/EhS9 WrAdaGy2w/8takYnb9r/2RUBpNvUaKhGvj7INx3VW3T2Utcpagck0hcmImMbFNwV JInyh/JM0PmhnHMwA2ZMfY4jgFPUKt7veFVACCKzD2WeHmDuzI923uXZnIeq0TBF 3UiczQ== Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gjywr22pk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 13:10:52 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-97cc09260a3so4996451241.0 for ; Wed, 09 Sep 2026 06:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788959452; x=1789564252; 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=hOiYjCn1nD7fLf7vrzvPOq3oVs5fH9mikkYiajsOtfs=; b=jTh8gmmHJtxwS5xJxJ5nZHBOnaEYT4nlgwoF4hycQQbOWwbjEvXGZb75dG6GADcYhx d6FqGy8FHJlXAawnnskI8fV9hzqgPxAquq4jGwhZWWWo7Uodx3MiOYfSF71cYScfThbX BaEVMb/7EqaEfyIF0Ov0gtzYkGJcjXSH2yQL3rey9mxNlNy6xdkZlA2C8rhI96+MVHw/ DT2iJcOAKJGfX3+C+Ms13frW9vKQPI3gVj4oGWQ/7Y5dgPdVYA0D9JTCVH/EPUjLyRiy F6tDQzHnQmDxrNCapumpAzn9P1wE6ACWi2yDFDhwPqLyovrkh8B32U6vbXHaK0KWKKaI +Apw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788959452; x=1789564252; 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=hOiYjCn1nD7fLf7vrzvPOq3oVs5fH9mikkYiajsOtfs=; b=DtFzDgJlijfe+jzIJdc3xeLehAPOVUl2ad0YGnnDlKuue3mkrZTJBN8qV42Y1ydtCi DFRGSsaRUWFc1m3X5GGVB81Xl1z1UVA8aqOe7kKSkC1xuIP0GhZWzOUoz8dZ1J1L/+wg vfdtoFc/hr5WiNt0KttQbqLFZoLIR4vz3JrJWMH/yRdKpkQNMKi7kRP27tfCuwMPP4kX MJPvf/FbYxTgJxPzqQ+hW79KP5rP5tJ7PEPAyMWxifsR9WY/HRsPL3ypDTHl7P9CHjBj 5eQoXfV+dyCX4nCLuxGiOvqn6YbegSVHjHcHBsP1WbQCO/EGLHtjZNRogbEPOISU53yz uqrQ== X-Forwarded-Encrypted: i=1; AKwUvBz7FjnQhAeSd3SJw43B7IskhKcfaGLftjf60muVRZMZz5Gea6Nyzir/RadEthaqXV8VhRnBeCrb4HWx96I=@vger.kernel.org X-Gm-Message-State: AFuF++mpzA6KZnm3HiCPJvqich30bwNGU9N2t40sRUl2B7bj6czjcvjS BXcuV68hBYxap76OAmjOnUhKooC72xsR95wE+SvMD5z5IALnxFQi8I2Bw9dJlYKnAUXfssvfeMZ AruGNTS8abiW5sWfe6dm2X5v1vgTiCJD4y3OADBGnff8PBD3ljSzBof1HMlTsG24uDRo= X-Gm-Gg: AYBFou3+flmBlsHByiXv4MHsjVP2HxoxgQ0Epvnqkuszzkrer91M8jGvxsSzFMiH3lp NHWY7s/atnWMiOs+q6kKtCQ5/2fvCAMoM1OUEfwLFD2V/YwdExHElbMRjgcOoZbSfP2CLv9Lpjn fNWE6DJ0IPPtBge1FjR96b0wPHY+A4f+d0T7t/eq7M0MuIJ9vhWIVISHfSZTeQZLfAkgkrIeM84 NjlJOk8iIGaksB0NYX3fxLZDaDvTDaZnd4NXhzm5mzBRiLI7fByzprZ0ssvfHIPCHtYjwD4vaDl X+cdivGLhYnhSjG3hS0Cwa793ItXNkLkjbuoZaybsd9cpOhSX/S2hpGN6DYx7A99jhn9nwbB0Ap VQkRGHZI5oCWwBWCQlsDIsp4= X-Received: by 2002:a05:6102:8345:20b0:777:2e1b:1e2e with SMTP id ada2fe7eead31-78a2ed7ca4fmr9287147137.3.1788959451828; Wed, 09 Sep 2026 06:10:51 -0700 (PDT) X-Received: by 2002:a05:6102:8345:20b0:777:2e1b:1e2e with SMTP id ada2fe7eead31-78a2ed7ca4fmr9287124137.3.1788959451336; Wed, 09 Sep 2026 06:10:51 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b8993253b3sm114594e87.52.2026.09.09.06.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 06:10:50 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 09 Sep 2026 15:10:35 +0200 Subject: [PATCH v3 1/7] dtc: dt-check-style: Handle continued lines in check_hex_case() 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: <20260909-b4-dts-style-checker-continued-lines-v3-1-474bb324ae53@oss.qualcomm.com> References: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> In-Reply-To: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3317; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=RpsFWGOJ/fmrFBjXtNLPVOkO7viH6czPpMx9xQdFNUs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqoVrPGXfUuPtdBIpfItRIq/8faBDqEUXCSWvZT LWnktbR13+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaqFazwAKCRDBN2bmhouD 12NRD/9skTUTazeBJO2H3VYgfmwxCp94eur2xV3GMbMDIbzjQE73Rc4AUHme8Nn0ezdmJTDhBaN zjGaq0lVyiQn6HQhVWcM+90hM11q+aAMk75Nx1ClAN5S2uWvh5REBaXSDh9EXxYBTgiVhdr/Xv5 pn8HTez7B0SlhZU0mDIlDPBvTyuUjwOfLO2HAZIu2lBD+isXl5Ue6GBIQz5pFW60zT011bxVbVs qEkGcEJMcMuEAgvXSYOzgWcxBZfgLvcwEfnekmzhuD25LQZJH+HZzFLQsezR15pSy7Cngz8g9+M HINbPYV6cJtFhvXv/LydWlLtnQEdYQ4L1odQMoUmW4sUGC6nMPb1ZpwuHHOkCr3mjX8TSp95n24 9KVN6Gxpob9egTuuRM4HZ0MqTDEKUW1fn8HxKm73RlX1C0zNNPnr+91ET8LKixDYXeXYbMumnQt KoEwVt2vMoIMDc9yrBKrv6OGdczRWzDS8DWsymp1C2Dbk/yhpjQ3pyYR/poTPsMzE0RGWQoqQcZ pk5SLFElXykoaHT4wsjGRwai14CiONt76lUYzDrUfMULlJYMzTgXx1j4k5XhHUNsIMDmbqdclIO UPqtGpDC572VE9e0MxD9/2i0twXlDLFUSR8AX4LPK3VI04JvUYzD8B2wnVj29hKsy9maisL9vTh 9ohGlbXM0UhUHxw== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Authority-Analysis: v=2.4 cv=a4YAM0SF c=1 sm=1 tr=0 ts=6aa15adc cx=c_pps a=KB4UBwrhAZV1kjiGHFQexw==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=SU40fdrgiSb2mxkwluUA:9 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfX04eIBcsG7cWh 48eZIK+WTKanwMZQWCqCIVQH0QSJbjUySYC0+O5c7Iu5lKIrBYPc6uDXVFG8+pvV4sVwXZeoy/p X8Xef0/zST9WP2Gqxadj/QnRbGz/8BFynV8XuaRulsPD27kdMKkt0l36M5mLrHxjT44R21VZHlv E/lrSUCo9bJKvDrlgwKrikznGfwTrm8LW6iGSmLlNcMAFnhCuNdhwbyNzoLy6bPvLjWOuU60iNP 6G/RZKBBeOg2H7b+zKG5w97E36/lHle3lED/VQy9M9C8TEQNPL/+un1InPlQde/pvMblgvDrGZm 34d3frzZsPIOl2dX4wEfjVMxtMJ6XlcdBrTVNODyxKo91FTA48qXvT9w+v5h7Vhns9qPdAeyQj7 4VrWXf51VORC89yv5lHFrqUH1nGm16BGzLrSochqOxqHi454dCVdsJ5YITCoB4EPSBmZ1TWBHoY Ub6QWqCk3a8vFJIpcVw== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfX0gsOLzCQ8ldp 8qvNMvQZtqFumq3p14CeHTNmpD4B8Zd6v7xT80DebiFbpJxFk/6awhw7fQqb6knjCFqCXu8Uo70 RFu3sNMUcAepyBkL3Rb9bwolKqLeaZQ= X-Proofpoint-ORIG-GUID: ioV-MtIRtp-zRBKhBaXU7RmWodkGY0KF X-Proofpoint-GUID: ioV-MtIRtp-zRBKhBaXU7RmWodkGY0KF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 spamscore=0 adultscore=0 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090147 Continued lines are not separate DtsLine items in ctx.lines, so they need own iteration. Rule for hex case is applicable to continued values as well. Signed-off-by: Krzysztof Kozlowski --- scripts/dtc/dt-check-style | 24 ++++++++++++++----= ---- .../dtc/dt-style-selftest/bad/yaml-hex-case.yaml | 5 ++++- .../expected/yaml-hex-case.yaml.txt | 2 ++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 15a3ba82fd5f..6d978c4d9832 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -547,18 +547,24 @@ def check_continuation_alignment(ctx): dl_value_complete =3D cont.stripped.endswith('",') or cont.str= ipped.endswith('>,') =20 =20 +def _check_hex_case(dl): + if dl.linetype in (LineType.BLANK, LineType.COMMENT, + LineType.COMMENT_START, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.PREPROCESSOR): + return + for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code): + lit =3D m.group(0) + if any(c.isupper() for c in lit[2:]) or lit[1] =3D=3D 'X': + yield (dl.lineno, + 'hex literal %r must be lowercase' % lit) + + def check_hex_case(ctx): """Hex literals (0xN) must use lowercase digits and prefix.""" for dl in ctx.lines: - if dl.linetype in (LineType.BLANK, LineType.COMMENT, - LineType.COMMENT_START, LineType.COMMENT_BODY, - LineType.COMMENT_END, LineType.PREPROCESSOR): - continue - for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code): - lit =3D m.group(0) - if any(c.isupper() for c in lit[2:]) or lit[1] =3D=3D 'X': - yield (dl.lineno, - 'hex literal %r must be lowercase' % lit) + yield from _check_hex_case(dl) + for cont in dl.continuations: + yield from _check_hex_case(cont) =20 =20 def check_indent_consistent(ctx): diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml b/scripts= /dtc/dt-style-selftest/bad/yaml-hex-case.yaml index c55359a4ca68..b0b8683b883a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml @@ -25,5 +25,8 @@ examples: - | foo@1000 { compatible =3D "example,test-hex-case"; - reg =3D <0xABCD 0x100>; + reg =3D <0xABCD 0x100>, + <0x2BCD 0x100>, + <0x3BCD + 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt = b/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt index 6600f7cd1ba5..f42490256939 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt @@ -1,2 +1,4 @@ # mode=3Dstrict bad/yaml-hex-case.yaml:28: example 0 [hex-case] hex literal '0xABCD' must = be lowercase +bad/yaml-hex-case.yaml:29: example 0 [hex-case] hex literal '0x2BCD' must = be lowercase +bad/yaml-hex-case.yaml:30: example 0 [hex-case] hex literal '0x3BCD' must = be lowercase --=20 2.53.0 From nobody Fri Sep 25 19:20:29 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 838A455C1A3 for ; Wed, 9 Sep 2026 13:10: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=1788959459; cv=none; b=dC3+7eBlDUTXj9KDmQyeB4WMWRJeS6Bpfi9wDMzafiOYJvIB34twdZcnAX3ORpsRTo/k5fL3rWAj8op51zh3lan3ql0zbRkIaRWCQF1OiXyaB/rp6WMY/4H4YvA1WPFh9MXDO87OXnVAPTy4rHxmgToNsv5uQcDk2BCXb/aS/58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788959459; c=relaxed/simple; bh=Ixb/AmdAstOcn9FVhgNt2Xll/IdUyQ44GvDHEBU3aaE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CQTNM3HXjUT11dcXlzYjGsam2UEABLWNQBesQlVp5JEKlxoTjdBwGHw+5r2eIV9ZZN+vuMx2Prvuc5qCP6N5SJwp3MtxJXWg+LWR+H2JWm5cfnI+uU3eusOK+dOmqGzmNJoZDLXUMSAQjytAHiH14FBtyXRA2d1kpfMcz2GO9RA= 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=DAtkTypM; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=i51PaaXQ; 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="DAtkTypM"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="i51PaaXQ" 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 689BU6ZY599697 for ; Wed, 9 Sep 2026 13:10: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= AiS2pGqIFKAf7u+eYdTRDO4CKrAlgaifUWeuWMxg02s=; b=DAtkTypMn04wZ1TP WbSui06HmTW3UHNwKc5XLh+GWQiORuQHKnyGnJZyR4d1DQ1IQD9KHBu3EgO/iPeG dYpjgeBb9fRBhgAbKd9a6+U9AHP6bKBHgzs/qurmuXwQ9GrlUDQG+GK9atA8Sfim rxUaDzz8L58Nlptu1RVcPHSLa+sJnBrz2o+zuj5foYpstr4kVNJad3FB6vxAmNPA 2+fglSMQUp1L/3ypBIiOql4fNQAOFChaNM9YqsQSl7Ht/uSZJ3/V0fa069EObEU7 Dg7RU8QXYi8rNnXyMidz0x3QM6j8RHG6Pq9ANbaCFa5+GeAI6AuVuUC7DlqJkNmd sPd1yQ== Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gjywr22ps-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 13:10:55 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-78fb9f59781so690503137.1 for ; Wed, 09 Sep 2026 06:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788959455; x=1789564255; 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=AiS2pGqIFKAf7u+eYdTRDO4CKrAlgaifUWeuWMxg02s=; b=i51PaaXQcuIhn0l2B1YVsFMZT1aHPtqAFFEPFAwyc+GMm/hzxeF5t/PNlh8MHF9Q/S /kiR7b/YiCGnb4p7UjKLs9T+RCx9VtMebm9v8TsRJjrQsSCONSBE97k8RktKALmXakXd 5/kKlGkP7h60h31AM+l7oAyhZ+XC9L8BdQyRMAlJ0+PVCCYL7DoYKua5h105qr1RpfNO 5k/0I3XsogyNe+LNKGPIygVnhSXE6QFEIpbJ5ZAngKNBY+o7oGjjYEJmcw6tZekBewNs tx9LWjWjN9nDIRyXgnixQ7fwkCE7QvOAbTDurlBeFOhcCJ3TCBKTamssWMcWylkCao+V A22Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788959455; x=1789564255; 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=AiS2pGqIFKAf7u+eYdTRDO4CKrAlgaifUWeuWMxg02s=; b=MpwfNlpRNGpSbG1taWv1LRA3ffBXlaIE2j6K1c7iG8CRjrFgDkhmW9bUa5Eu1FoEj3 JAX4zVcGnCh8y+tbYOgQ7ffBbtlKKYZkFATO4xu6+GQz3F2ktv0+6CaaKqnkvvVleOk/ zyG8CjUNDkaW9zbGcM7Nl+99tpdP9ExJrLXBuNK40G4fEdJ5zzmfTg12zdD2w7lE+NJN j6SjXs9dyv8P3yBsXiYwDv54/M0tvFp9GdUbI2xASkJGDnPHmO9h5VdcEq8wM0bYpuig +rz7jy2j9QS7TWDhNiLb7W5Y7oCi8+If4xYYgqrYbx7JgYnO2wSlRhGqQNxyHizjchz9 GcwQ== X-Forwarded-Encrypted: i=1; AKwUvBxgMvs0j8MXIQD2SWCYOD92bg2n8lPY5MW9/ZozQZDE0KNoPyh1zZdQeLDrxs8vXCFu3SBUpkmXcnIV/1s=@vger.kernel.org X-Gm-Message-State: AFuF++nzGRu43tjaXye8Xjuu6dc0veNvWLwE7+9Uqi/pw8x0/ufn6FwO vp2uO0wuNo4U+iMPnR7X5scwDDm9DuK08zBt+YkFtudaWFNpaSu3kxFXy9cSruygf6cXIel5fAR V+jBClJvR0ztNejAp5IzuYxp00pj6nXR6Q61Eum9yeRE+NoY9vlVIkjAk8DM0c9p6qtM1HUu724 E= X-Gm-Gg: AYBFou3diNp7iM2HJ9kyoladwNlTRk/blN9f3cI6dXeqFFqvSfSPYQWPl7uwAAnP9jy pGoJ8I8EBbzLvSqYPh0kdJCDvJ9MQdzf56CMzhBlq7h0bWJaVjz9wcJg0qfaLrRA5BrrfPGx87F mthZV++pJrd8j6R9a3RV14tYYTe7oNEIeOAjOJpjtk9kqINNFeg7PKqmCHTVSVuSWAM1GMVTzoA 9SRSPaKW2lNamWdBgnNbv+YvFTIhF+4/0KQbuS9a7bqB9CRoFWlm2g7DLmQBlDQAFIAlc4GZSQQ NVgklpcZQfi6JiV15w3QDhSNR4rZJFykVO28X0XiQIRsqQCQ/OF+EFoJ4Fp5EekYfiZRPM7RbqM 7VIcN/wYZmNYglAbx0Clundo= X-Received: by 2002:a05:6102:5e8a:b0:785:eb33:87af with SMTP id ada2fe7eead31-79078210c3amr485362137.10.1788959454511; Wed, 09 Sep 2026 06:10:54 -0700 (PDT) X-Received: by 2002:a05:6102:5e8a:b0:785:eb33:87af with SMTP id ada2fe7eead31-79078210c3amr485329137.10.1788959454022; Wed, 09 Sep 2026 06:10:54 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b8993253b3sm114594e87.52.2026.09.09.06.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 06:10:52 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 09 Sep 2026 15:10:36 +0200 Subject: [PATCH v3 2/7] dtc: dt-check-style: Handle continued lines in check_line_length() 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: <20260909-b4-dts-style-checker-continued-lines-v3-2-474bb324ae53@oss.qualcomm.com> References: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> In-Reply-To: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4091; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=Ixb/AmdAstOcn9FVhgNt2Xll/IdUyQ44GvDHEBU3aaE=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqoVrP3y44K/5QKTimSkeef6hsl1b6Ri9MoiD0+ GTehlOA5mCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaqFazwAKCRDBN2bmhouD 10qdD/9/+rRPDUfbCB9PEoX6U2Fy8f4AOv+aXooPfKpn1TL9qMi2cQq2aJpiA+OScLO+uyCl9Gm R7CyaMslr8fKXc5CwhXXUVUl/TUfokq0kZD2GgoumgKtoHLvburs3YbyH1UTznKCvOAdN/kH415 0zYW7j7wLGaK3vWNy34Ho4e3UnEJlYxnEVaMhXpFHIHeJ6rNxnIFkz35zrRgwMdbvAwEZ+mLE2W eETQPeN+3ARhqjP3RPOm6wLJZ+GD7YYcvKna69SlRWKQwL1qDa6VNBfPg0eETmrwFLTxwoBNm+L GTNPDQqgyjhAQycvYySVfKcC3g/qfO48Bh+yJPiEP8qF8CqnnEYgF73FSpEfv1M0ceR8ywP1WcT nBSUN9dmPyb42qLg39BqCnm6hiaKcwi4XdhcvOZa7HSWBbfkHky6PwdFjh+JAPupsVm88IV13Hk XFnAMx5jy2jSUGnaqMeYLjrPaEllv7cWaoGm5tkZQqaL0X75mFMvwXWMgmfRU0/Lh+dyRFSFHnm +rhlSWt7+q6xidF65VhCIzHBWrZ2pKE6AuAOBcvj+Ta5JlUTVv0U/U+VuJ7vf4cBDDwdaUERR4g SbMfH6F793sIFwvgGaB7d3kw1f9izxyXKNrS7TYvQZcqchuDfuOuFy9D3jgtT+xUOreICy8ZTFv 36aA03vhFaQWYFg== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Authority-Analysis: v=2.4 cv=a4YAM0SF c=1 sm=1 tr=0 ts=6aa15adf cx=c_pps a=N1BjEkVkxJi3uNfLdpvX3g==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=jHdmtohXv_5nRK-EuSoA:9 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfXxBU4dUzhwKd/ fwqJg9cTZUjw31Ux5A8FPKTvKLdLKSNwhbZuJ/blX6evSZa63oxLc5BQe3TBHQkqmj38DwKxehl 9GgJ0SaFxk+09T+SefVu2VkCnzvE1wG4vG2Il9VTD+o7yUXT5mLNvQ2c9XkO/fW/xvhUuPqtmpY eZ/6ZPmK5lbj555m+ARKIjrNXaV5FzFqMxW8e35U9K+85iW0h2qf3G27xBbSyxBluIqqz3FaGcn TMzzmZ/ivacM75jcJYVJ1h+iBA9czcuWtOEw9DGuQbl6RcD+xdFgzK0hcMb3n9hJje+Ic7Lo9hX lqEZx84afhrhVVDhPdtGxLhnu3CoDHdmM7s4GfV2sFY8S5KCn1CfrV/9/6+F9MHwLEKmHfhUtJA imVwH+5aQ6Gt2DrEcFD6GBeWagosb/fFr70/+8d5aMvwqh55I3fRCeUx7ds7fHVKZeowuDU7rAP iz+dQLc48V4GfHk8O5Q== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfX6NlqH611J4nw n3UUWIvBNszsI57QIA5shCePkiSUvfeqqVo3R+g6C43dSknLXkM2/fHiMQezW3ZTfGl8SCqcohp IeGC2XBp+Q3x7XEm/7h3Rsk55BwPGWU= X-Proofpoint-ORIG-GUID: 0Xv8CstdXGhBdCWrzYqhYOJ0irDii9li X-Proofpoint-GUID: 0Xv8CstdXGhBdCWrzYqhYOJ0irDii9li X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 spamscore=0 adultscore=0 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090147 Continued lines are not separate DtsLine items in ctx.lines, so they need own iteration. Rule for length of line is applicable to continued values as well. Signed-off-by: Krzysztof Kozlowski --- scripts/dtc/dt-check-style | 18 ++++++++++++--= ---- scripts/dtc/dt-style-selftest/bad/dts-line-length.dts | 3 ++- .../dtc/dt-style-selftest/bad/yaml-line-length.yaml | 3 ++- .../dt-style-selftest/expected/dts-line-length.dts.txt | 1 + .../expected/yaml-line-length.yaml.txt | 1 + 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 6d978c4d9832..ff5e715593df 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -627,16 +627,22 @@ def check_indent_unit_strict(ctx): 'got %r' % unit) =20 =20 +def _check_line_length(dl): + if dl.linetype =3D=3D LineType.BLANK: + return + cols =3D _display_col(dl.raw) + if cols > 80: + yield (dl.lineno, + 'line exceeds 80 columns (%d)' % cols) + + def check_line_length(ctx): """Lines must not exceed 80 columns; tabs count as 8 (see _display_col).""" for dl in ctx.lines: - if dl.linetype =3D=3D LineType.BLANK: - continue - cols =3D _display_col(dl.raw) - if cols > 80: - yield (dl.lineno, - 'line exceeds 80 columns (%d)' % cols) + yield from _check_line_length(dl) + for cont in dl.continuations: + yield from _check_line_length(cont) =20 =20 def check_mixed_indent_chars(ctx): diff --git a/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts b/script= s/dtc/dt-style-selftest/bad/dts-line-length.dts index bde91a922477..adf40e3c95f7 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts @@ -14,7 +14,8 @@ soc@0 { #size-cells =3D <1>; =20 foo@1000 { - compatible =3D "example,test-line-length-this-is-a-very-long-name-indee= d-yeah"; + compatible =3D "example,test-line-length-this-is-a-very-long-name-indee= d-yeah", + "example,test-line-length-this-is-a-very-long-name-indeed-yeah-se= cond"; reg =3D <0x1000 0x100>; }; }; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml b/scri= pts/dtc/dt-style-selftest/bad/yaml-line-length.yaml index 6e4140e500b5..6b1209ee4f26 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml @@ -24,6 +24,7 @@ additionalProperties: false examples: - | foo@1000 { - compatible =3D "example,test-line-length-this-is-a-very-long-name-= indeed-yeah"; + compatible =3D "example,test-line-length-this-is-a-very-long-name-= indeed-yeah", + "example,test-line-length-this-is-a-very-long-name-in= deed-yeah-second"; reg =3D <0x1000 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt= b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt index 8ed08c309632..9cdb7550b56c 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt @@ -1,2 +1,3 @@ # mode=3Dstricter bad/dts-line-length.dts:17: [line-length-dts] line exceeds 80 columns (101) +bad/dts-line-length.dts:18: [line-length-dts] line exceeds 80 columns (108) diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.t= xt b/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt index 89b36360caa4..f21b823c6136 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt @@ -1,2 +1,3 @@ # mode=3Dstrict bad/yaml-line-length.yaml:27: example 0 [line-length] line exceeds 80 colu= mns (81) +bad/yaml-line-length.yaml:28: example 0 [line-length] line exceeds 80 colu= mns (88) --=20 2.53.0 From nobody Fri Sep 25 19:20:29 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 5183055D882 for ; Wed, 9 Sep 2026 13:10: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=1788959460; cv=none; b=fmEx2smkZU0HjHddZBuYxB1my3DlKKLBZsZ/VbgvcQLCGPfxWRrRGexVntfmmDJwu4qapj7ADWMH5asEC8ZF9iULv5lrBSADv+aEg9Qs/lQ7leaIWitXHRfZPP9fMDtt/XvgmXbi60RLIDnXcqpdQ/qswiaro+cCWi4jyrAJyUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788959460; c=relaxed/simple; bh=IWHg3NxDjAQuyvLPrxd0bg+vjcwN4JdBqQLR55GtCQI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XF2JPZmRMPvBBIHSlUjXC22R0zmFu1ughr5Suh4Je6s582iI/+/tQt1B15CWS8ZiqEkuxWeCby6iQCOqsO+5KGaIXh01ef9JkPLVjAkbusqpkEfHB0ve2QG6QdNsRkVE3yanm9OIaQhjBSjHB9EIcU8Jobz9/qJOyz3wOI2m+98= 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=h0gQ8qgY; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GY3OjkZR; 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="h0gQ8qgY"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GY3OjkZR" 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 689BU6Nw599687 for ; Wed, 9 Sep 2026 13:10:58 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= KOoY6mCIop7DLsgHwFMY2E+1AD8DaONcY4sNreB3ZeY=; b=h0gQ8qgYGJlEmNzk KlsIgk9rdc6MVh1eMqzOAhKoZi6lcdhQxLYC/AWDb4fcQ8c47W1S6jTFtjX8QiHb O/CVQwWt6ZPHeVUcNRkGn1DB4MgM69YyMojMgEypKwUbIEiM7SVC+Jghvjps4kTy BfHhCC/4qrY6upCDPrJ/ARJGXPIXgKW7jX1pmm/KhT6lCs0cEVqyuJGtOxUbKESk 24cQIfBj9vdhKBPhKVoCMWvDl2ahXOgc1GqBPl1RwN5+/4xOJCfouR6+S1VIBLSV khtOXwKBqQxeA/6ZuRaNIK3kScC494NNXWRkEowRbGxyebtma7OZihMa26RisIvO KugT7w== Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gjywr22q1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 13:10:58 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-78350646d7eso5121038137.1 for ; Wed, 09 Sep 2026 06:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788959457; x=1789564257; 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=KOoY6mCIop7DLsgHwFMY2E+1AD8DaONcY4sNreB3ZeY=; b=GY3OjkZRd3Su6M6cAZfmLMTZrc0idVO07GlvRyPGOQWBEkxluyaoxih7eev+O6qOjB SJOOsLbSXApY+QXqKpIqJcUIl8n+E5x0DIsT6QlUEo5oXMEoKKa13sSrdaOUzTWtbCcq weUAHxVoW8M6wYRugAv7cQldb/PxO5kZasDpxtPoH60Pvt0kVIg3BxuxK9UHtKJ0ygRL +W0iDe1yjUtDMYXLON4yNYi2Dsq2Fb6aS0HtbYq+WVYeNxZAFk1exKA/UxePhi+XwuvF tfRItedoqYzYqihD+VH87DlR/mwcnYF6znp8HqJ04kNFdpRzrASF1wrTycp/WAKhwuN+ XzjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788959457; x=1789564257; 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=KOoY6mCIop7DLsgHwFMY2E+1AD8DaONcY4sNreB3ZeY=; b=hD71tys59s7p1Aq37rHDdD8xN5w9TTbj0dqSF8jRMsUX6IGZpXyoj9zbozI5/pFu0U kGC0NT/TJW2imhRWaIsa587oKU7dUwDDsFxFa/oUAtzxMICUtdlDvj9/c8WqmY3cTOuC 9sdUPVLom5Z1ipdZfjQvFsnCpeRIVyDzmykN6KS41IIMrs3GRgXmckVYUNFpVS32gbBc j2wuI1USZqZfzt10FWsaM/AlJtOog8laIc/F1OJI0yjNsavn14m9cZeCohZcgyWX+6R0 hfHSU2nmOjuHShXzH3kdJ4Jb4gw1Tpu/iFJhXEkH1nwZdlB84cR/qMXeyz/Y95fn61eH BHWg== X-Forwarded-Encrypted: i=1; AKwUvBys8YACDrWYvBfWI1Qu4IJq0qC12yISXxpYVbZ1AhX8jD3eTzmXueBvVECS5cPoUCz0sw6mrxEGBeb5bV4=@vger.kernel.org X-Gm-Message-State: AFuF++lG8k2trPnbrckSAVfK9ti6YJ+to20S3uJPJP38uyplYg7s/ExZ ZNvmsR4jbGjQFrJSpPRA4Gx7/VovbBGT2uvwJafAO0UnRF5k5rAvwGCBHBzutQyWRLKvoFJsYc3 9BQmJiZ50p12ubZnve9aKj3+hmcLPCrbI97v0b1DfBTI7NgqJQ6s3IBW6O/u59slHCtc= X-Gm-Gg: AYBFou1V06UsfrvW+F8u+SIunH4xIIvcoDVZ+8Ej5Gh6Iftc+EJgJ11H9/usGm7DbW3 jH2q+8HuK0XwmRCJsIT5VCB2aK0XKaLz2qaqFRjRkLpkWGCvtNvhkfDdooovASsfn8C+wIhxT0W 3KacAHgd7FAGQCoFbxeysu93BwuFQ/TnD3x+zodOBBrH1wKrZYPSQm/z88syDRiugNlG1VwSI4Y 7emBDDXh5aIZ96mRypiVCd+9G7pvei03oKfLV9Gwxq3Ow4bu+6tOC5j+eHWBscJweSVyJWD89KK 5EcdudgGsOwnTR12qc+e/MGjcVV+45Ldcd3XC/1VRe8YwDcBNL3z1zBaXIYPzZ6wYJV4BfJ+VSP h225UM1YEEKnEMMzCKooBvPg= X-Received: by 2002:a05:6102:8487:10b0:78c:d14d:8389 with SMTP id ada2fe7eead31-78cd14da8d7mr3449096137.18.1788959457275; Wed, 09 Sep 2026 06:10:57 -0700 (PDT) X-Received: by 2002:a05:6102:8487:10b0:78c:d14d:8389 with SMTP id ada2fe7eead31-78cd14da8d7mr3449079137.18.1788959456631; Wed, 09 Sep 2026 06:10:56 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b8993253b3sm114594e87.52.2026.09.09.06.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 06:10:55 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 09 Sep 2026 15:10:37 +0200 Subject: [PATCH v3 3/7] dtc: dt-check-style: Handle continued lines in check_trailing_whitespace() 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: <20260909-b4-dts-style-checker-continued-lines-v3-3-474bb324ae53@oss.qualcomm.com> References: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> In-Reply-To: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3744; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=IWHg3NxDjAQuyvLPrxd0bg+vjcwN4JdBqQLR55GtCQI=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqoVrQ/wrQD5dOUAzOlhOoUz2/yu4cVQ4j5dxvs nNDgSAsnLWJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaqFa0AAKCRDBN2bmhouD 19VsEACWac7hLVBKAEoFjIbxvmu9r9yLN4dCqP4+LDIaaYtD/49g3hCdUXrQpPHcB57xCtLD/SR yhNiZAajXDw9ggsbgzOBMUCBrTOYhFyVplej1k0yQbUb5EopQ6BlDxEsUOU/LP2CPQfuvpCRBrA gnyejgfTmoP/QnBnl+AUnolJwNicm3vnMKVKYU3Ocl9vAK4UyfDT5J5et9BtQ8zA9rsqS+0dSrE MzdDO5S6mk7CTglzwUXAw9/eRN1kGu8ZZtHKpEaPb0ZLNLX4w9sbNZYljOapfql4xFI72F27Qp4 TcW9pFnmHDTIzJ8HslzOyPj4+QE5+Q9ZDMXoH6OzZ6osYshdJnDpYQFjH94+iPq3wd6fYI7uqDb 8dxwb5pil8K3/LXD/Ttk7dNy2p1TiI2Ru5GCqq62ZuGgDG+TmjSUXRgPhWISpN/XIoTmDrCK5dS BUE6lk+beXIYsYnvf7X+sV0mWIF0HU1muRYMmrFU35iymhxzkT2A/aAsM50KefiyXNwypknbVBY Ce8JDCfs7TKfGdA2QnV6cG+i6clw61oPVqx/3oXAbG0JakdP7e/uflIhH6lHtEs+flOREizfsZr fEfFBZWxCotARW1f15bRcUenoYwkEfJ7/xjovlpqMhEOl+vHnTg60YdeRkZAJyRLKoZQZJ/lDRt YT9l9q44e6fQHZA== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Authority-Analysis: v=2.4 cv=a4YAM0SF c=1 sm=1 tr=0 ts=6aa15ae2 cx=c_pps a=5HAIKLe1ejAbszaTRHs9Ug==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=n0VsRDhmN3h0bdBGaSQA:9 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfXxuxkqHF5gccs Vp30xuwAUZZ1Kmg13z3T1Z2SoVwwU4Qn8aiVgz2Gbyn0Q7z7nAIS/Y9ONsdL5WVW91DTeTamRcT pT/eWGojyyi3mKb6+BCpJKYF6coHftCz/Bq+2uFoXLhCVr00I3GVaVj4xUCwwPsrHPDGMBuzVMa 3GXGFBWd48Gi4A+RmBssvaZTMqwX8X1pwGaw7K0AAGJCNFuXJzp9Cn2S1toysdJUKy2sBLVIhZw lWV4rqp7AkOooUQ7aVUf8vcM6IsfTFujAY84Nd5LSav6UivACrhVHJVwwodWF2qRt+b/ZWI2Omz 5ilANpBr75JZjKZ/fFU+iEsvpF19RmblD6kOcy4xn/OoBRetaPyC1/050w7quLPteDQx7t2plzb gEVj0tPxAXD+Jy3/lNw2BuWbFz43BLa5BwFEWsf9vJg8vIZ/uSTE5sEQNCrV2gb5Lu9By5dWNQS QFgK4GPM3FbbobOVOKg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfX2g2pKJJ0DhNE dMPD33QY5v2pRA5l6zHhc3cf8LYbDeKAvdhCcjwtR5SGp8jRsFTNWnS2e8Zfu4DGRge1kQIyh7l 0yw8mIM8Q1q4NP66rSBOC+aeQZuJcXg= X-Proofpoint-ORIG-GUID: 8nxW9etMDEa3jvSNOTM1YzZqtzWtfnP7 X-Proofpoint-GUID: 8nxW9etMDEa3jvSNOTM1YzZqtzWtfnP7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 spamscore=0 adultscore=0 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090147 Continued lines are not separate DtsLine items in ctx.lines, so they need own iteration. Rule for trailing white-space is applicable to continued values as well. Signed-off-by: Krzysztof Kozlowski --- scripts/dtc/dt-check-style | 10 ++++++= ++-- scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts | 8 ++++++= ++ scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml | 5 ++++- scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt | 1 + .../dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt | 2 ++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index ff5e715593df..3694b0b1ebb6 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -985,10 +985,16 @@ def check_tab_in_yaml_example(ctx): yield (cont.lineno, 'tab character not allowed in DTS exam= ple') =20 =20 +def _check_trailing_whitespace(dl): + if dl.raw !=3D dl.raw.rstrip(): + yield (dl.lineno, 'trailing whitespace') + + def check_trailing_whitespace(ctx): for dl in ctx.lines: - if dl.raw !=3D dl.raw.rstrip(): - yield (dl.lineno, 'trailing whitespace') + yield from _check_trailing_whitespace(dl) + for cont in dl.continuations: + yield from _check_trailing_whitespace(cont) =20 =20 def check_unclosed_block_comment(ctx): diff --git a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts b/script= s/dtc/dt-style-selftest/bad/dts-trailing-ws.dts index 1eb24d91c640..73c24525ce18 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts @@ -5,4 +5,12 @@ / { compatible =3D "example,test-board"; =20 #address-cells =3D <1>; #size-cells =3D <1>; + + interrupt-controller@10000 { + compatible =3D "example,intc"; + reg =3D <0x10000 0x1000>; + clocks =3D <1 2 3>, + <4 5 6>, =20 + <7 8 9>; + }; }; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml b/scri= pts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml index f338c14174e6..17eeed3411c6 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml @@ -25,5 +25,8 @@ examples: - | device@1000 { compatible =3D "example,test-trailing"; =20 - reg =3D <0x1000 0x100>; + reg =3D <0x1000 0x100>, + <0x2000 0x100>,=20 + <0x3000=20 + 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt= b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt index 94d9ae9d616c..a15a7d637c30 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt @@ -1,2 +1,3 @@ # mode=3Drelaxed bad/dts-trailing-ws.dts:5: [trailing-whitespace] trailing whitespace +bad/dts-trailing-ws.dts:13: [trailing-whitespace] trailing whitespace diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.t= xt b/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt index cfdbc8476c73..4f2ec9572bc6 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt @@ -1,2 +1,4 @@ # mode=3Drelaxed bad/yaml-trailing-ws.yaml:27: example 0 [trailing-whitespace] trailing whi= tespace +bad/yaml-trailing-ws.yaml:29: example 0 [trailing-whitespace] trailing whi= tespace +bad/yaml-trailing-ws.yaml:30: example 0 [trailing-whitespace] trailing whi= tespace --=20 2.53.0 From nobody Fri Sep 25 19:20:29 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 EB13D5616D4 for ; Wed, 9 Sep 2026 13:11:01 +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=1788959463; cv=none; b=a9WJLreFG+7KstziFGxKxVYHw0kvfjP8r2imOmSU1SfpQClP6S9m3VqORl5jKKh0NdVGFdztK3yuIdUx9RbDRBYYBndkHog1KlHvf4XVdgd1T0NgmfFfaGnOq5SgfwRuEZQYrjqCumv+XLFDGqpOsE46F/Y6l3YKjknpspQLAY0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788959463; c=relaxed/simple; bh=ScU4Q1sbQp1Xs4mqt2cQd9K+HDzcB8jlgVskOjnMNEk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ngutv2dt/1PalIp3hAlwSPPn9qf6+sUrt1J1MPcFoBoAVpHM2Fqc5FafWOn+iEmc8FyMAvEW8h6o0msR05OweGXKQIlCg8f50REqVtnn1K7yvZNw5olGzTYNKmmJO6r/Tagbv6CJ4lUc1WjyINcIHiI1C9HgWspivn831w+rEmI= 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=inowuSUK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VNqCN7Pd; 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="inowuSUK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VNqCN7Pd" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 689CChsl1400900 for ; Wed, 9 Sep 2026 13:11: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= nT3s+bA7nVVLt18MsRU52fYMWFdL5/irMJJLhFbs+4c=; b=inowuSUKSqq9tSfL /dPYXirZIX9AINrJgrutcgSP6KY/amr905HOUwk4oMHxTCAk63PxQlcFFM9ijO91 wRvd94TeFoDVEPufEBeLIt1Ld2c/b2trk65QmbXhhLM4Vtp1sJJc1Nojfj345AmV RSRUoMQ9IPm0jco1pB3gf72O8NmIuFr7yuo1Xv7SuaFpssRfvuTqoYyz4iEHo/hT 62nXrLLhyv8t+qFsCYb6kS0GKEGYeDIG+bZZpnXp/ge5glG4t3YQUmVqgYYlk/RV oR2Fp5MAVs3fcRHg5vfkMHmlzFHSfEfyrxJTsQJ6DBj2/0m49/4FHa8UlHU3WzZD fGvHMQ== Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gk78x06x4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 13:11:01 +0000 (GMT) Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-73858d44c8aso1288825137.0 for ; Wed, 09 Sep 2026 06:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788959460; x=1789564260; 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=nT3s+bA7nVVLt18MsRU52fYMWFdL5/irMJJLhFbs+4c=; b=VNqCN7PdFZ4vzfVg9L2ucVbfFEcWFdC68VYa2KH/apkAdbf33NPwKuqc2hxMa4DyuX Z/SyP8/OSyq35uCogpX5MTtwhag7IueWZ2IucS7ySjmR1a2Or9XkfwgALc/hWGaMCqJu 3sPP7iqSav7gAXZG/mBLRZsvl51y2Jqgusnw1Y+uyNauTJLqPK4OqyQIL6HCjnelBtkX 8EfA8wOHfk6EtmYXEsMcLRDFvsElG3U52JHUsyo1RQsKEXcok8fXTOAxjFKpQPEeW4RO MtKxd/8BqgI10iUBcUOpsu3aVtBVlKZH9Yynu16SON3/FOBeOTb2C1zE9LfvqBE9efQg XlOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788959460; x=1789564260; 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=nT3s+bA7nVVLt18MsRU52fYMWFdL5/irMJJLhFbs+4c=; b=rAc6gEJQg0T7tYsuxPjry72Cw+XWxVs7dQLkoOaDwvr2x9u5NLF10lDuqkSOac9zEc 537x1R7lTEgQT5LsOK+7SVxABqhuUprnMzuf06faPO5jX+vAMx5QrN8pQUtJBArI0SNF yVytCiQdJn3zaKbxEigtksgxtgS2hbuGjtnuDjtCJ89WBjJJ/ebK0eJAlOYitdyuThV/ lyna9saJ6vXEUIsHU2vXWPnx/sNXjS21tHkDS5OJYr133LmnVnNqTZDMFfK10PrHE4Gs ljlE0wtmeZ0MEKJoIPPAkG3apZFKdMUf3X0BcLr8rvVqcijTgNot+02QN9AbLcaphzGk 49cQ== X-Forwarded-Encrypted: i=1; AKwUvBydH4uv0KICKY7fmUY54qO4MAzpBGhwMVshCdgLwQfuAcoowr9HzE5uaZtmTMGlbLwMy3l7Y8uDiMZN5Zo=@vger.kernel.org X-Gm-Message-State: AFuF++kU9HKaGWzSRAZLOTB733lderXd+dF02tpfE/ttD0OY+QkNJc9d Kd2UoOlkdXrnITNBq/n/RjaT757PbdSqU/k2pz+lVmDu8vUURjG159EUKe61BwrMn6O141U0hsK 060Fm/N4w2t40BKSefkpD8zvH8JBTUzDyUJyg1CefYfeIef7CPoc+Uv36b5NlNekTBs5x0nRxap E= X-Gm-Gg: AYBFou0jP5n1LGq++V5C4U0k+C1GNiotvRAZNgqbiksNNgqNKSA0aCmJEZ6o5TjyKeu xVjHcwJn/9Qk2VX15DE4KL22ts2uFJ25iubkZ1pzOsUKDSpK2Epzdn1UD73AeXtrMwaZhXEJKjr 6fFag+jdsc5Dn2yJF1gjG1Q8EmMlkhKOC4bzBvf1kKgfbgVWSuefMoNbW8EQ5VRexgUG7sMGZNc yLGI2pGXlZTFWdBtjzcbgCOIT4o57C2X8ftmpfUPJI4iljgCLynq0D0QdMGwc3B1cetGXse9dTT x74IMegyDEVOza108c6Z1Fnz8rDy6oNQJIg3F5pgft4soNTI8LPlaqCFuB83n/ovo4hlUuRomQX T/+oxqlDTHZh+0199O32sgWc= X-Received: by 2002:a05:6102:3b05:b0:78f:7135:b4ff with SMTP id ada2fe7eead31-78f7135b567mr2623184137.2.1788959460027; Wed, 09 Sep 2026 06:11:00 -0700 (PDT) X-Received: by 2002:a05:6102:3b05:b0:78f:7135:b4ff with SMTP id ada2fe7eead31-78f7135b567mr2623138137.2.1788959459639; Wed, 09 Sep 2026 06:10:59 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b8993253b3sm114594e87.52.2026.09.09.06.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 06:10:58 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 09 Sep 2026 15:10:38 +0200 Subject: [PATCH v3 4/7] dtc: dt-check-style: Unduplicate checks in check_mixed_indent_chars() 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: <20260909-b4-dts-style-checker-continued-lines-v3-4-474bb324ae53@oss.qualcomm.com> References: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> In-Reply-To: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2325; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=ScU4Q1sbQp1Xs4mqt2cQd9K+HDzcB8jlgVskOjnMNEk=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqoVrRrRI6zzm5briuYbs0yf1ag2QLfH7FNHxYS UPCApH/6naJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaqFa0QAKCRDBN2bmhouD 18WhD/94ZXIgQe8HU9gjJfBcYspsrhLJnd2VrX+Kdleg5MF5C3+k9F4j/sRb+JeTdvzf9VtS8Hv PnLDvP/RLqO+BqMpbHyzk8q/6a493EO8YnB9L4ehnSTkMl+kKc/RA3GK6PlfHlb6Y9BkDXG6kbz RSSnADhHFhtETGD4GWvLXzczR5z3Z2HPo7jIfPFt6EsFIXXxt2eNLoDnP7/mKtSyMH4gEx6xMWl j5nvhkR4McKFcIPiq041EnNGtCBfBQK9NRJ2TdbfS+Laq7z+xG1LoOcFus/9ulG+On19ewhyIFP l55zeDJIIG6QdBTyA/mHZFuMVSiIkdSXfdsDZysf26d2YaeBLXJaSxyeX/tv6oABRkF422x+DSk HfBTeU5mzt6qE95Zkn54QVtnCOlNnKup3is615L/7lBRkNq+rA58CgNOue18FSefus2I5mriuKe 5MRIEvCGXbyT+ThofTL+jWNnFTDnGQI061Amxn4ApCewwsojhjbQtV/kFLjCHZC5P08798V6sdY TXZRDr7uq2jLRxAizkbv9n0D+bc5rnS/pUmHxIYmrph13CBFJMSzRNbD9Yq8CXuc3sAQsq6Cku2 erg5veF834Zz40UfSZBPixo4cFy5+fM8+ajr+LDuk0pW8Wu9cluyyrHEIjMe5ZiOPXd7xnuWF3q YyT+Avy3HQaEjCQ== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: QftjPgwUbL7Wi8sOvyn0MOGOxGjfKc0w X-Proofpoint-GUID: QftjPgwUbL7Wi8sOvyn0MOGOxGjfKc0w X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfX15JDnQE/sGtn 7E6hoSwfC9ncwkNWVB3GiYnz0jvyzA6vDz0mjAeybCJMn0RD+xoR3u9aFj+3MVzVxwkmxHMNwbI 5tbD6qPGBPtjX3k9/m3e7+ekYXczEQ4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfX8EsTtr2apWx2 bo3hpgTS3kDvOscbf8q0qQlU/i9mW9Mq0hbHnsmxJapgNy5AUF77r2wavDTsys4QwYpmZ2AJKb8 9ClEaT6OUPFnYN8efbIeIYEebPCLcNQUarRhsTBytbRugZh4n5eiEzGA2IFtvqeaxvzU7q0JcQx xCwpaZuOLnv//NYBd2XdB49pWEErv5D2dF+0h8c8YZOJtxl0HDfC4KXB0nsbWViv/zpKyJBEpTL FkTARt9raon5JA6Lrn8QqTQBRJbZYkMiWD6iy1hi8UrHTcAoHBLQUTnCx40+ZzQQArflwKU+4sr 4ppI8BBi5mRiGC5X3dpFY1ZGkOuU5KjkjiY2AMCNzGeiOYufXqE3H+GmUbGSEeCgZmrtkQIfzut mryJsOihhBd2WTehIC5OME09mjyPz3aNtjcAVpgZCPXdSAmStkt0oLPGHRxDiHU6d0N8YN/7P5D xowtwGgjl+oPMfswN1Q== X-Authority-Analysis: v=2.4 cv=SvWgLvO0 c=1 sm=1 tr=0 ts=6aa15ae5 cx=c_pps a=DUEm7b3gzWu7BqY5nP7+9g==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=ZNCJMhPrvMW_IMsXWMMA:9 a=QEXdDO2ut3YA:10 a=-aSRE8QhW-JAV6biHavz:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090147 Code checking each DtsLine and continuations is the same, so split it to separate function to avoid duplicated code. This has a positive side effect - if DtsLine did not have indentation, then check continued to next one, but now it will still go through the continued lines in the second loop. Signed-off-by: Krzysztof Kozlowski --- scripts/dtc/dt-check-style | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 3694b0b1ebb6..2ff9fdc50367 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -645,27 +645,24 @@ def check_line_length(ctx): yield from _check_line_length(cont) =20 =20 +def _check_mixed_indent_chars(dl): + if not dl.indent_str: + return + if dl.linetype =3D=3D LineType.PREPROCESSOR: + return + 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 than = 7)') + + def check_mixed_indent_chars(ctx): """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 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)') + yield from _check_mixed_indent_chars(dl) for cont in dl.continuations: - if not cont.indent_str: - continue - if cont.linetype =3D=3D LineType.PREPROCESSOR: - continue - if re.search(r' \t', cont.indent_str): - yield (cont.lineno, 'mixed tabs and spaces in indent') - if cont.indent_str.count(' ') > 7: - yield (cont.lineno, 'too many space characters in indent (= more than 7)') + yield from _check_mixed_indent_chars(cont) =20 =20 def check_node_close_alone(ctx): --=20 2.53.0 From nobody Fri Sep 25 19:20:29 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 BC0505616B1 for ; Wed, 9 Sep 2026 13:11: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=1788959466; cv=none; b=n6yfDgCGkWgNhhDU31qtZqgXvthx5+6oidcIYm825q4FhC1gJ9mnE+YpgIG31id5B/na613bwPTzFzYYyRrWuWplJ9LJTIn2NoQFr7n8S1sSxE8dcutm+ksb1UsPfKpwjzMKOxaUa6cA411kDQ+MMWtkeoHKzhL6ejKsqSlhsGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788959466; c=relaxed/simple; bh=Ue6midJSVmgV6ghv2VQrE9scJG+SviUg2vZbqL6/1Ok=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rV6Ke3s2gl0JhAmjOukzwsDkJlvo6wILd9n/wRBGLXZha9Os+Pf/pubpI9KAks36QyGtIQ7i2HFkLYTCBHTJzxMi5dQJpACdhYpOaZp0YwsquFGv8eg33v3226YdphZbfhmYyO1YTMROwImDrS4qdCtm3BZlHebtuOxP2EMNxSI= 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=F10twoDN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KL7m2E4Y; 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="F10twoDN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KL7m2E4Y" 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 689BUCcq1843087 for ; Wed, 9 Sep 2026 13:11: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= A/C1tmOXI13kUzfS0ML+iY5IwGKaZltTvEDgs10XXe0=; b=F10twoDNyO0LODhw rwN87gP+QPXEmeCIP1YUR89ef/UOyxAd2KmukXwv5i95U2cFAmpxIXUEVPLHGTC3 k/i/qqCGUCRKae8dCO5JWDKoBvvWcwvqgKHWlyiqZCTbNOD3ynUKDdOGtKH0hGW2 hoMq6ALqdejXOoTLabL1fknTHQDYyUK8vtX3kjz0zw3zVsMilbUkvtdhfC2xHU3m r5IZA99tA55xVLSWzR9ZQtZ9pYL5BKmsAw4jDutEZxtSZA6Gd9CSaK3qhdI3xGE1 RZU6Ls1UdxTuB5yjm/EgxN/FmQnS+q+j+07vAbRUaas5ZYinlQPY2Ng/jVe2SsLw vHOWcA== Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gjxqjacc6-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 13:11:04 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-9808f4a12d5so470601241.1 for ; Wed, 09 Sep 2026 06:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788959463; x=1789564263; 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=A/C1tmOXI13kUzfS0ML+iY5IwGKaZltTvEDgs10XXe0=; b=KL7m2E4YLStqcKNlNfsUgMuhxwdvstO8jcuPwTEJ7MVu5Y8O9fe+z886DVCi115N/y RXU5EWCAYCYMOMaLwZPpL7stWljVeVi4fO5Fdik2e5nPnAuPnfx+xyHKeKr1ADWnvCOn C57reL08sfaaCFw3l2g8G+3Woi6m1dKd5uvUBJnnzo7ycqxxpOb/vSJYVQ+4vvza9eTk a3x+q1MkGrUHjYXurN+tOW7BpEF40lPD5ZE4VDuKHqplaJdAJ/U6Hv+8Bnn43YzP9kll nep0LxdWs3Uvxeslbtv/PbZ+MqnTuIQl6wSAEtr6mxRWmeGiomyqydsTHyNKbkc7Zq/n qx2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788959463; x=1789564263; 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=A/C1tmOXI13kUzfS0ML+iY5IwGKaZltTvEDgs10XXe0=; b=We0hlsVLe4ZhGg7gbprna3axnxXq4EE06ZUQgZG4SDpWajjh0oTkoMSVaqSpN0Y/bT WfmOdm2XijIkrGRLvfaIYvKJkRDAMXWJN4AqReSTUISXqZLMeIJOiqEaAb365AFYplHC x4c2yxSR0EAInpVGQnV2bA5zsZPAY2LBsEWxsXN0vzRgZ8SY5wVouNpuj6Er/oPrlzDa SEmuhRp2TV+BNWPYZcJ1Qxm5B2solcstoRDzIv4VAbqj075UMk/BsVcxV/2KhfIX4Z7X 3h8USAfHX13pniLRHjI7v7g4da+5lANjOCQfVXs1wg6+pV3itp5mI+bBk8atbrmZqd8Z u/Iw== X-Forwarded-Encrypted: i=1; AKwUvBxeLqoZHqDrytspOEHKXPgkMhcXJpW+/lWSzmpttnZEH6M90sn//0onCbdO/QrhrEenX8FXR/siDzSICuQ=@vger.kernel.org X-Gm-Message-State: AFuF++nRKEKTYhhuyrnLbs0nzhLftlxD5e10H/4aOfFoU3kVemdtwIxo V/Nfk5XdBPrvrs/pqGcxx5oZOkJa9jatz7c82WkWjTqa/Uq2YBl66nIRG3+3nJ00lxyTHhS1QI0 qp0rkmrNOfHydeSGAFxmJxPrcKCaGh412Z+bPqBq29lc1boegVnb4M2WSuIJYUGi6osFqiQbVjh k= X-Gm-Gg: AYBFou3u4YCGOOgcQl4yI/xmnTgjSgvwvzX93nTg1XViZ7zc8pJ9Nsro7z1ZeRV6zfD eMHK8rVRJktBPBPU8uS1TYR8a0uVU7iyK1MUSTbUMhh8eaptzGUN9dMs7wgLS+s6VFk2cBqvK/w 7LoUp7uXO1rk19LzkKgNiJv9VKMMzDYjVbcIGPU3/B0me8vEh0sodWnOcDSFiT/yDA40oZ8R1PV RkTWBXUJQoVYGqv0IIA7SLszh5G/qrXR0AqwBZIsHco7pby/zta4yjh/VJ0nBXDxQH34nnouDox f9beo+Zc46G9Eht4d618XfdMf0OlRh6nGaodybJOulQVy9+02pBonq9aXDiTesJj9Dms+dZdwgw t80nVdPKAxKTxAXq1SFp+6xo= X-Received: by 2002:a05:6102:2907:b0:778:9033:e337 with SMTP id ada2fe7eead31-78a4a7186d7mr13868977137.7.1788959463038; Wed, 09 Sep 2026 06:11:03 -0700 (PDT) X-Received: by 2002:a05:6102:2907:b0:778:9033:e337 with SMTP id ada2fe7eead31-78a4a7186d7mr13868901137.7.1788959462533; Wed, 09 Sep 2026 06:11:02 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b8993253b3sm114594e87.52.2026.09.09.06.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 06:11:00 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 09 Sep 2026 15:10:39 +0200 Subject: [PATCH v3 5/7] dtc: dt-check-style: Right strip whitespaces, leftovers before comments 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: <20260909-b4-dts-style-checker-continued-lines-v3-5-474bb324ae53@oss.qualcomm.com> References: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> In-Reply-To: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1119; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=Ue6midJSVmgV6ghv2VQrE9scJG+SviUg2vZbqL6/1Ok=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqoVrSDM2IbCyPpO2rKNkkugN+JiRfuzZxYZt7k LlhL1lU1f6JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaqFa0gAKCRDBN2bmhouD 125rD/0b1CzXHuHBW4O3c/s8PwdOsFKkSMQ96G/EaqO+aQ1L4NkQbr3B4AGGV+5V8YWwzDTZzQd BNpus1cS1sgXm7G7IIk2h92CT1Qu4XzgxcbELNmXl/7trpKvSF1ZFbr2HnoGJTrbsatD6t685DH Xt4mHmPNVH0YPg01XuOUlnV11wDrkRzhhsd0e2uHuorQY0+SXQyV0J+bkuYcwehw0OxpzhwbMpv q/GIoK2v8dBISevSg++RtSexn2MRRBWxHZkq60Pu5J8EL5poPaalf98HidMGRHszZv7D5zhj7nG 4gab6iWMcXqlyV9dVC4EVDecc4U6YEvHPikr8sCVCK1KtwvFe33hCcCWQH6F6EWWg7Yybbe7i2J O4S09qE3cnVFpY+lGRZCme69rutC24Q6xfndWsV0DZGPTV5p4bWD97KyUtK/F22wiAFZSxlef/r Q2o4uaQtsAozYoQ702bJRN9g2fnadO1RiXUYkLdgvmt0rpa9925nVl+GHUOHDxpiMx8bsk17JyX UNISuJ8lkQiFznb7IPi4QcWRdmjdqrzQ8wkkcNk1drZFwsSMmRW7kvaQmg/7esG+adUu01SSAJA Jn2Q6OpQ8gJ9JleGuEDRQGTB0alI0TWZiU0ud0Bj8YKvdrtkVeQ0wJjNoBNZMRRoj9f3skEYg8s bt/aem7qE7/qY8g== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: 5l5I1cBzJVdaKC0cc8dDXwU5ZDB3orAY X-Proofpoint-GUID: 5l5I1cBzJVdaKC0cc8dDXwU5ZDB3orAY X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE0OCBTYWx0ZWRfX4UEx0sNomWQ4 HptFoF5sVCgWlSJ1bNPQHPmXWO+iaQAZFH08Bc2hfjgAz1w3PkYf9FZMiJZsyIiRkartbTuYVL6 HSEH3QI1/PMfm3n63UI3H7blafZnEcDif+rwOuv79LNtx7lqA8+rPE1UEyttCQxHxPfy1hJBU2i pnzZdAWLddCpoRSJ+DOjgjozw0m6YyYKPpBfrnwIf7jYSC6JNvqcD4zEIHni6vaGnT1Bp3zRFD+ awrEgvvhCxFOKi64g2NCxeLr1H7EV1gJ7RMed3HUdugA0nJBEn0HuSk441mZfzkW5XUVsdYnPm4 UuG6wZQ/9lFMUtQYLaSqMhEzO4tWh0vsOS5hZ9zR5HYJQq1eOyHJuBsYuv0/4knY1PldPAvRD1/ 5pcHj0jKF3cEVZNzL8Q3ZzowgGM1jzO2haJ6sW2uHZyAFAA86Y6E2GHPuBSficYfO+5JJ5mwbH2 9Cji8WC13kJkEf8KYrA== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE0OCBTYWx0ZWRfX//5eorM4ezXa SIPMDjpOLSYWPYLsPIcadKrV1I0VC5JhX/aBp9SK4g3f27zo9F5Fm/GIIwlapqWlxRcMSrLy3+a mPnxrfEbnK0pLUBGRZH+wnFWNyAZYwA= X-Authority-Analysis: v=2.4 cv=f/p4wuyM c=1 sm=1 tr=0 ts=6aa15ae8 cx=c_pps a=KB4UBwrhAZV1kjiGHFQexw==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=3nWb1Bopbj9nUPZVt68A:9 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090148 Stripping a comment from a line to get the code leads trailing whitespace (e.g. in a line like "enable-active-high; /* comment */") which will break DtsLine.code.endswith() checks. Signed-off-by: Krzysztof Kozlowski --- scripts/dtc/dt-check-style | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 2ff9fdc50367..b10e30f9d5b9 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -91,7 +91,8 @@ class DtsLine: self.indent_str =3D indent_str # leading whitespace as-is self.depth =3D depth self.stripped =3D stripped # Code without indentation - self.code =3D _strip_strings_and_comments(stripped) # Only the = code, skipping trailing comments + # Only the code, skipping trailing comments and space between code= and trailing comment + self.code =3D _strip_strings_and_comments(stripped).rstrip() self.is_root =3D is_root self.prop_name =3D None self.continuations =3D [] --=20 2.53.0 From nobody Fri Sep 25 19:20:29 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 60CDD2D9EDC for ; Wed, 9 Sep 2026 13:11:09 +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=1788959471; cv=none; b=MsbE1vuCYf9GTM7Vqpl9jKetvowUsJYZAcadPu/+7MdwNI4N+Co46KnY/7O5HRsEWMIPOJdJBrRlZahg1sF0vqkyVbm7NpLdUpomqc+bfq5sUJ42avQFPMdIBmOp0zR8wIXQrmFA9ebnlHR0caxfVglzeryfKaHGNnyXkH7hc88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788959471; c=relaxed/simple; bh=a5Ll65DQL/M59r5nNeLh7x1BtJXBfuJyRxs44gn+Yao=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K6Teoyimeix4xHdKgc1/ES7v2yEg6IeQG7U4Ox6Og/kC0MfeWXfm5wr8XoHJ+8Qy+IMwsXZhu+VDsOUTK4Rile0ZyXGsZ7biQpZBObsuf6//88rykFybDxUQRDVq1b+7HPnO8xOBgdLfpQzl/FV0raeF74SLcIbrodfah0xLHmQ= 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=QcejDYss; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=a4EyPGsY; 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="QcejDYss"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="a4EyPGsY" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 689BUC9X1183802 for ; Wed, 9 Sep 2026 13:11:08 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= hk1PTahrJKUV4aq/e/3rFwDxJr+19SkoWjJe/cVir0c=; b=QcejDYssY3sbzcIx 39+VXR60U0x/WjIThqKLajlFKWhVZc5Dz7STHatGR1yFbm0uvBL5lOAB0vVfUFwD tXTKKoyuD9QEu8OAFKQ5qsJxAZy1pCMdelR0GVP9HUWwipRtU2ZThgK/FaW/9BjO C02QWfkAjr5R6cMGePDWg9M5ll2g8yL0xgo4LvDOWTCskEnTJhl6KaHuStziPdm6 5Z0A/JKdoDywU9nkt0/U5/9vNjqxS8pMHSKcYNvrs3Tl6zYQA2kmkQ5bzXLuK86h +eFijkjywCpDBpy1tK9L+SmBhjcY52e4kbz4RXO0U7yIlvq8vk6uGdWkuc40FCEA CsCN0g== Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gk559rr0w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 13:11:07 +0000 (GMT) Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-73858d44c8aso1288902137.0 for ; Wed, 09 Sep 2026 06:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788959467; x=1789564267; 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=hk1PTahrJKUV4aq/e/3rFwDxJr+19SkoWjJe/cVir0c=; b=a4EyPGsYw4ZqOCyfaPTpmO0N7TbPjaGBRf8FrKozopZY0lulBrG6rQ1WSFhHjQhT8X +7APY5SK7s0Uhb8K1C5LJzcp0aToATVfjMh9/XB/nUd9IOZMUHXWQ8zaFjm46758gOoN fYtVpv68zgY9k09/42LwavpfL9ylHdfAKdWyKgVOUZ7oA9ebpdeqAE0c2dPlg00f1Xcn 0GesUi3FRphsnj//O5AkR1jhkXfo1b0RNAX2epilqWvvL8xFqmbRMHBTHrOPM6PPy1A4 P220rtcJXHs75w4eLP+IKIEupGE+dEJ/2Bc0AuXU2+64DvPIKd1goesB167UsK6bfcqU FK9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788959467; x=1789564267; 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=hk1PTahrJKUV4aq/e/3rFwDxJr+19SkoWjJe/cVir0c=; b=P8bR1fwPjJTUw6jqSCSUbKeGB/FaFT1k54rgfo0e4spTZ20HVq33+PySa85VBdBAhl a9LMQnsS59E/JFcoGtbEfbfFiATbss2LNJx2vxbRRboXCImpw3nzlCFLPfZgtCCXVSvM 1wvZrdDLK0XnmfiHUbNPGWgRsY+EFP70h++BzQ+agnYwWaNS/+MTbgCJqew9ukRbcMFw gqkOWx+8rAYeDnsUZkbx2VRu3DkW67nfck/FC3rpZhj/2klPvtZkJ9lX+AU/ijtYUvpR h60hMO+slN61Ezhm2g4aCIU1ONzEFALnE8MNXf06pt6A4CBeVwL/1RJuSMfspKlYTiA9 sTjA== X-Forwarded-Encrypted: i=1; AKwUvBxbzIM2qFWfSFPzOk5yzqHoHrTbObMoT2Wh8C+ZNpzR4KYVOQ2MQEGOjRxKFNEQOzYuhgcMpeym5rke014=@vger.kernel.org X-Gm-Message-State: AFuF++kOjvb+KTyuFfpDnlIFxVlehTj6TJz4coLB2p/xa+9L5QQEShwz ya8sWX38CaFQpNKDcil6I/YBlFutHxCRGe/5OpXCwExlP0vAXsqp4C8yOWoAX3btlSQebYG9Y/y GpVxOIKrpPJwcQXb9rMtz6vphWSa/Kxn6I9M1XMUelv9mFETVzn1t2ztazZME1iOb9Oc= X-Gm-Gg: AYBFou0WOQd7qLVf5UoWgFKgIWQaH328k4QFock8gtGPyBxDb6ZDpJqh0yUiYNiKo1L Ikf0SK2tRaC4RaqRljeFvE6TlFjcvyCIBD23DUjGADzRUW/F6pHFZg2xsyodEkPZKJjzxWv/YsL Rii/RFX369ch1fWBNmS0a8LtBukO/G+UptMt2lorXWWhvNInUJBLlxYSR4zkUDArjth7UktF4V6 CVP8QyHDZ5ld7OSZnb71qhRjEXND0L/TvmuQkw4SwdpXV1hiXJPxW0LN18x84VFfHm2onEb6bXy /Jr8IYpvvOr3elXIzfuwHnPswRJ99iG2ZiWu6U4vxjd8lAVzGiWzUzGk0v3o9XgfxEaTOeM+klD rUQasup5kK0HIT9EUtc6CvLQ= X-Received: by 2002:a05:6102:1606:b0:778:9e3c:5760 with SMTP id ada2fe7eead31-78a4a9621d7mr13640079137.11.1788959467060; Wed, 09 Sep 2026 06:11:07 -0700 (PDT) X-Received: by 2002:a05:6102:1606:b0:778:9e3c:5760 with SMTP id ada2fe7eead31-78a4a9621d7mr13639737137.11.1788959464962; Wed, 09 Sep 2026 06:11:04 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b8993253b3sm114594e87.52.2026.09.09.06.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 06:11:03 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 09 Sep 2026 15:10:40 +0200 Subject: [PATCH v3 6/7] dtc: dt-check-style: Properly detect comments in multi-line properties 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: <20260909-b4-dts-style-checker-continued-lines-v3-6-474bb324ae53@oss.qualcomm.com> References: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> In-Reply-To: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=8587; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=a5Ll65DQL/M59r5nNeLh7x1BtJXBfuJyRxs44gn+Yao=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqoVrTPm7Rix5NOzayWIPaO9i1d54MCz9hrT4X9 gIeMDWzUvCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaqFa0wAKCRDBN2bmhouD 183WEACLnXwXJW5RrMqHIVXCOyKTXHDmWb98aTxjEXNl2YvXiFRuox42RvtI9LiGcN1zDy5y4Co hIlAB9Bc/T7dCocBbjjOwjtDWGs32hTEKJJVXZ78XdQOJOLLgc5lziAxJ8jAJfJ8CuI8IGJgxBL pPHPOGrhAv21bIrSdxHHK8Vz7NqdZIccVZWsedmhAHgH2ySq5hNYYGabxP6QZFRSOAjOiteM9oT S75XBOLlbkp0Sy/U/PEaxy+Q9zdS5ciNQTDjtCLprQhAFgSYlHr/TpouqjF0aG00niHeNBPiVYO S2N1kkGLxMugUFzkJJcWwqTz3J3cSFZzAh4cf6Ujy3mYAk68E7+e+shuYD4UCl/uYgRDdvQ1YhO c66LrihOqzdcXgq99Vz/TM7Fmqv5UG+5A+KUreCEOmuWU65zUYs5zw8Z1wALGH3jL9ag4kqIdYJ 7ODQcNuuIr6RjdzWIdBuAYtupeWmtquyTQfxIbhW3GmLaDgzit6NZ+YZOBCsnMo5yNBA6Zx2cTs 8CDyfoUJVO2QJJZBL4hCLIY1cE4vyj2BRiKPEoGduKcdlQzl9/M8SRSVsy8F724AwXUaw4stvX6 rPYViSpWLVNgp4Vr7aN+Jl4aOLspJv873GoRWIr5BwgXxfcOm3V88WWSiJtz0rVc/nyUqsFgoZu YDuZ7Chqrvv7fYw== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Authority-Analysis: v=2.4 cv=KP1qylFo c=1 sm=1 tr=0 ts=6aa15aeb cx=c_pps a=DUEm7b3gzWu7BqY5nP7+9g==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=Y8AG2edEbfE3NdgbFfYA:9 a=QEXdDO2ut3YA:10 a=-aSRE8QhW-JAV6biHavz:22 X-Proofpoint-ORIG-GUID: phtCAE0ljbLoNOrS9ihN3fAhBEYTwrXM X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfX5THOJ+NJGkfM SMBd2QdT890T94dg64Px8QLaq09axCY1E0IoiuxPdMxhz9vjoFp1yvdtcYDnKf9YRjsSw3zk7oe Vi4U+IxURu6rlB5YbM4M+1Mbqrrss5M= X-Proofpoint-GUID: phtCAE0ljbLoNOrS9ihN3fAhBEYTwrXM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE0NyBTYWx0ZWRfX+GtyRWKimq6e IPnTj1ks1owNYrItAf16BjE5mJOexHvKv/TqQ5bfGkP0ENzB/QQtTyEw+SfidUBUkyxrB5R0qxj j1XH/APIyn7qn90QXtgYKnXVrNGLSW5nn0FS4OKIpuoAn/WSVId/S3dOveBGjvLNlr6MGNsw4T3 LNtkqRFV3L3oddr+/HEHnN6VQNf9St/EpnZ3p9xQH7Opal1srgkf+RYHCBixEyR9oryNwF+M40W YhuHRo9301TqYK6DGCwsgV/dXWBwTsoqkNdOnJ6yPG9baOtABTgWY7iY/RPZvdtUJdZ6Y0up6yG C37pt7E9BFALrM85Ph0LYb/hSoMn/mcuc5P2zYoG8KlaaH4cq0gkhdTroMui+bmmzqt49TGlNko iVEr3IShxh1NTo2tNyTbb5PQkxtPy28Fx5dPkwTsWxAjpoyOBmWnSejvb8KhGr+2FG3iWT5C0lc NWVI6hoU4hB4lhTnR9w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 suspectscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090147 Code classifying given line exits on first condition match, thus a line consisting only of a comment in a continued (multi-line) property, like: interrupts =3D , /* Performance counter interrupts */ ; was treated as a comment-line line, not as continuation, leading to false positive warnings of invalid indentation: arch/arm64/boot/dts/tesla/fsd.dtsi:456: [indent-consistent] indent mismat= ch (expected depth 3 * '\t') This needs two related fixes: 1. Move the judgment as a LineType.CONTINUATION earlier before one classifying as a comment 2. Check the comment-stripped DtsLine.code, not DtsLine.stripped, to verify if it is a continuation. Signed-off-by: Krzysztof Kozlowski --- scripts/dtc/dt-check-style | 19 ++++++++++-----= ---- scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts | 1 + .../dtc/dt-style-selftest/bad/yaml-cont-align.yaml | 1 + .../dt-style-selftest/expected/dts-cont-align.dts.txt | 11 ++++++----- .../expected/yaml-cont-align.yaml.txt | 3 ++- scripts/dtc/dt-style-selftest/good/dts-cont-align.dts | 1 + .../dtc/dt-style-selftest/good/yaml-cont-align.yaml | 1 + 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index b10e30f9d5b9..9fcb2eeaf7fe 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -202,6 +202,14 @@ def classify_lines(text): if opens_block: in_block_comment =3D True =20 + if not prev_complete: + dl =3D DtsLine(i, raw, LineType.CONTINUATION, depth, indent_st= r, code) + out.append(dl) + prev_complete =3D (code.endswith(';') or + code.endswith('{') or + code.endswith('};')) + continue + # Pure-comment line: nothing left after stripping. Classify as # COMMENT_START (carries to next line) or COMMENT, and skip the # structural classification entirely. @@ -211,14 +219,6 @@ def classify_lines(text): out.append(dl) continue =20 - if not prev_complete: - dl =3D DtsLine(i, raw, LineType.CONTINUATION, depth, indent_st= r, code) - out.append(dl) - prev_complete =3D (code.endswith(';') or - code.endswith('{') or - code.endswith('};')) - continue - # NODE_CLOSE: the canonical form is "}" or "};" alone. A line # that is nothing but closures (e.g. "}; };") is still treated # as NODE_CLOSE for depth tracking, but the multi-closure case @@ -545,7 +545,8 @@ def check_continuation_alignment(ctx): 'continuation should align to column %d ' '(%s)' % (target_col + target_offset + 1, err_msg_e= xplanation)) # Align to the value within <> or "" of continuation (so the p= revious line) - dl_value_complete =3D cont.stripped.endswith('",') or cont.str= ipped.endswith('>,') + if len(cont.code): + dl_value_complete =3D cont.code.endswith('",') or cont.cod= e.endswith('>,') =20 =20 def _check_hex_case(dl): diff --git a/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts b/scripts= /dtc/dt-style-selftest/bad/dts-cont-align.dts index 5390ebbf4059..91a74887c774 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts @@ -11,6 +11,7 @@ interrupt-controller@10000 { reg =3D <0x10000 0x1000>; clocks =3D <1 2 3>, /* comments with " < , should not matter */ <4 5 6>, + /* but comments should be placed properly */ <7 8 9>; interrupts =3D <1 2 3>, /* comments with " < , should not ... */ <4 5 6>, diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml b/scrip= ts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml index a5a9eb17fc17..0189b654a5b0 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml @@ -27,6 +27,7 @@ examples: compatible =3D "example,test-cont-align"; reg =3D <0x1000 0x100>, /* comments with " < , should not matter */ <0x2000 0x100>, /* comments with " < , should not matter */ + /* but comments should be placed properly */ <0x3000 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt = b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt index a7ed62677a2b..fd7f389d6cce 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt @@ -1,10 +1,11 @@ # mode=3Dstrict bad/dts-cont-align.dts:13: [continuation-alignment] continuation should al= ign to column 26 (to < or ") bad/dts-cont-align.dts:14: [continuation-alignment] continuation should al= ign to column 26 (to < or ") -bad/dts-cont-align.dts:16: [continuation-alignment] continuation should al= ign to column 30 (to < or ") +bad/dts-cont-align.dts:15: [continuation-alignment] continuation should al= ign to column 26 (to < or ") bad/dts-cont-align.dts:17: [continuation-alignment] continuation should al= ign to column 30 (to < or ") -bad/dts-cont-align.dts:19: [continuation-alignment] continuation should al= ign to column 27 (to the value under <) -bad/dts-cont-align.dts:20: [continuation-alignment] continuation should al= ign to column 26 (to < or ") -bad/dts-cont-align.dts:21: [continuation-alignment] continuation should al= ign to column 27 (to the value under <) -bad/dts-cont-align.dts:23: [continuation-alignment] continuation should al= ign to column 38 (to < or ") +bad/dts-cont-align.dts:18: [continuation-alignment] continuation should al= ign to column 30 (to < or ") +bad/dts-cont-align.dts:20: [continuation-alignment] continuation should al= ign to column 27 (to the value under <) +bad/dts-cont-align.dts:21: [continuation-alignment] continuation should al= ign to column 26 (to < or ") +bad/dts-cont-align.dts:22: [continuation-alignment] continuation should al= ign to column 27 (to the value under <) bad/dts-cont-align.dts:24: [continuation-alignment] continuation should al= ign to column 38 (to < or ") +bad/dts-cont-align.dts:25: [continuation-alignment] continuation should al= ign to column 38 (to < or ") diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.tx= t b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt index eb9a84d5c222..9e98c28867aa 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt @@ -1,3 +1,4 @@ # mode=3Dstrict bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuati= on should align to column 11 (to < or ") -bad/yaml-cont-align.yaml:31: example 0 [continuation-alignment] continuati= on should align to column 12 (to the value under <) +bad/yaml-cont-align.yaml:30: example 0 [continuation-alignment] continuati= on should align to column 11 (to < or ") +bad/yaml-cont-align.yaml:32: example 0 [continuation-alignment] continuati= on should align to column 12 (to the value under <) diff --git a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts b/script= s/dtc/dt-style-selftest/good/dts-cont-align.dts index b52ee6cccd8c..e6450a1d8209 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts @@ -17,6 +17,7 @@ interrupt-controller@10000 { reg =3D <0x10000 0x1000>; interrupts =3D <1 2 3>, /* comments with " < , should not ... */ <4 5 6>, + /* but comments should be placed properly */ <7 8 9>; pinmux =3D <0x01 0x02>, diff --git a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml b/scri= pts/dtc/dt-style-selftest/good/yaml-cont-align.yaml index 8463075f9f4c..4a5b5ad43ee8 100644 --- a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml +++ b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml @@ -27,6 +27,7 @@ examples: compatible =3D "example,test-cont-align"; reg =3D <0x1000 0x100>, <0x2000 0x100>, + /* but comments should be placed properly */ <0x3000 0x100>; }; --=20 2.53.0 From nobody Fri Sep 25 19:20:29 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 1E345556BA4 for ; Wed, 9 Sep 2026 13:17:24 +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=1788959846; cv=none; b=N7LEZ1CeIm1twAt/PBpHRp/3kXAR4ui1moib2ewo9ZkwkJOqYK6/xdpkEoKu2g5KsZ/OrwUvJJ9eoW3pYyTG2J9xe/Df11tijmGlTS0m2NCHZrQ9kPPnpBayWvGhoBcNef/FibtVA3ngSBKgglL43evJxzwxKkdV/B4Nl5qcp7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788959846; c=relaxed/simple; bh=P5QjNrk8YCBoewGYIMDFOF+DssUYLxeljDAGYw9Rig4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b/FjyvskyQnFrLr1riEtQBKQXF1VM3dah2E0N9zwc4KWRrvN7Yj+rpm12XhMp0YJHRqeucod4fLipszJmOXtgnMiyz5GDSb+FeRkOQ6Zh1kRHEYuR1v207t2mru+9bV+co4j4CCaBCBq49n6IMTSp9uGZ6fro4MvOdBZpzesqyg= 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=h5LWEgJ+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=e+EhUQna; 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="h5LWEgJ+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="e+EhUQna" 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 689BUB2Z1843024 for ; Wed, 9 Sep 2026 13:17:23 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= pkgy+MhX4grX8MkGh52r3vqTjHDSVCmckqvAW7qpwYY=; b=h5LWEgJ+tlPNU7tB TeSI0ZqXgiObk7k9ImxqneggjbbdoUOgMQRGyqrpT2O0DFDl50In7x4Bc5kHCi8x vKD7xvFWrlKIRCJuRNdialJgCITD9VDBwF8dkqtjsVhLSVxy7X0dYjVqB7yu/3wl anMUUpqQAfCiRtyDGLibcazwu/T08/GCyh4Nw0Hxx80uv7nmGSo75ufk5ttdfFhV CjtefKxefeT4bzBHpCI5QSI88y/XIHm3wnNljTdNz1QfOG25pIaWqIzUkDBKs5e/ rtNmEPMo0o4XXq7RyCtzdFURVznSAaUv2adaxAVUUXpL/e6l+yjT0QcgvpDXH7Fk cFA4Hg== Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gjxqjadd6-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 13:17:23 +0000 (GMT) Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-5c82ad4977dso840947e0c.2 for ; Wed, 09 Sep 2026 06:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788959842; x=1789564642; 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=pkgy+MhX4grX8MkGh52r3vqTjHDSVCmckqvAW7qpwYY=; b=e+EhUQnacGoqFlIBXxqsv7W9SezDF4/xea9ErwK5glHrpQcR7sKk6pJsU/BBsYGXW+ 9tXQoKSGLJooQ1Msd1WR9rWqXLVIpo9FAYJ7d5pRF346YDhQd0K82BMbJ9YcrFvCg9oS IfnjLG3TMbOpfKBwNIJjHtknsytUoFDBRenZ3dt3N+tRVwSerFeeanlnG1qGDBgyoQi4 jdhwcvma0eXeekskjlhj95gjXpXEWTCPvDpvrpQCRxJU24z4h4J+FoyVh6Q3InTMSgbm 3D6nma2bbRDa9TO0rn5588bVjDQSU89ft/6CQ9M+OGOg/RyeZl3p1jjWqlTDRgZR4S2f nfoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788959842; x=1789564642; 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=pkgy+MhX4grX8MkGh52r3vqTjHDSVCmckqvAW7qpwYY=; b=UJ+PVLCkUctyGeOKm9ooEN/tsfokcuZEmNjgkVF5YlaPXNyy68cPJ+4rWAftznEEoN A3mqexUuJZ/qHJJZj2D/mQRqf4tj3Dhni1j6qy7vE0pZGd90SpiXg4ZIHnI7mr8qI28L OTonrGHeerLbuMgyg4ndW78PigCw+hp8F28pLJGkRphS22QTSPp9pJJRwTIuSm2aIIcX HHJbm0M7/KsjTdL3IF3fKZLmB4zKCIKzhq3eXPupOIehiVpQedKC1/pm4zwtHr3T8WhG GuTcZ9Wazr1rsqoQ8kJ/UmzlWDYoSXLpDy5/WMx/oT3UtanURVLC8eUDvqOVuBflePOW y3jQ== X-Forwarded-Encrypted: i=1; AKwUvByh8OgwteXzYrrwmi1+djQbWZrKxVPvB0zm2khaqZryFkgwcjzx+cMHAHSENvWoPV1+2LyJmYKdY8oVNTw=@vger.kernel.org X-Gm-Message-State: AFuF++kpWfRJ5CICn/GbhJ9ea2zcPdws8aQuoWrbL4dYNHhLJUenk8uj NFTLgS0FLmd5lAO+BtalQ4GjjwsPugiYeekYjSB9ltOFBHwNglM2R9Dz81AlngcDs/+7Lbp0Fkk JZKK3qCco9yyxxUWi+3sJB95okdJbLLFP46w3lRzlqbDFcrpHz9vqrd2LRKlfTZOq4FEwAo/x1t E= X-Gm-Gg: AYBFou0tnjyc3+iwyNHz9Hz0hg/Q/FCzeacPJr7HjNgM9mB8pDAZ4WBv+xiqZaKfuDe MFrPHMrD8yK5eB8bBVGoGnTn0cmKPXBIx9pgorRfDukEkpGBps2/x5LAQNR0c0WGDWfiOPRmUzA vaSFXnGxyCgKR+2gz2STKs+uoZfnfNUQGduVDpVjmTN4gXV0KMZO/rrj7EZEhm/eSdgvhXxQnL0 eqG5ET+qBb2DlYkjmuKiPUcq7IpItvuMZLpzge9kfts2dnE/YvrJ0y+XYqynRYanf/rg/BcYHkU 6TF2MdkYwpUY9g3oGnB5RBaI3TBNeKVWLQBEmd33GWytnmlC3YMcPSPp1naQxhV2zsGFMkT8o3b N1/dQvP2lQgrTtbG1t4RHV2s= X-Received: by 2002:a05:6122:3a0a:b0:5c7:9947:5ceb with SMTP id 71dfb90a1353d-5c7ed3796d6mr20337722e0c.0.1788959841993; Wed, 09 Sep 2026 06:17:21 -0700 (PDT) X-Received: by 2002:a05:6102:2d0a:b0:779:c38e:de53 with SMTP id ada2fe7eead31-78a4aabb603mr18682510137.10.1788959467492; Wed, 09 Sep 2026 06:11:07 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b8993253b3sm114594e87.52.2026.09.09.06.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 06:11:06 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 09 Sep 2026 15:10:41 +0200 Subject: [PATCH v3 7/7] dtc: dt-check-style: Relax property ordering rules (drop alphabetical) 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: <20260909-b4-dts-style-checker-continued-lines-v3-7-474bb324ae53@oss.qualcomm.com> References: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> In-Reply-To: <20260909-b4-dts-style-checker-continued-lines-v3-0-474bb324ae53@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=19738; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=P5QjNrk8YCBoewGYIMDFOF+DssUYLxeljDAGYw9Rig4=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqoVrUq28GZYGdDB5XHTV0FQTXUcouWoAxdc85C YfM0WUgQ1qJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaqFa1AAKCRDBN2bmhouD 1+58D/40OIzaOuIfZxShgj3qq6uhRLG7Dk7JLN/DjBoozjn1FxyyyGCOZUs5+EvayYZRJX+1FtB cQZV2Ka5ruUiUHY6bz+S6vK1KD0Tkxl8w7wOS54kUWAz0IvsspuSXX1vLUAIKTP6jr7l/pg4wS+ ITqFFLlRCTRZuo5IpAOYJ6mmBLEkRE1lV1bkUEyVJuh2NClWmZc9ddq4u/2bAGh34j3D4D4iAOE FWuB2s3PGb4eZq3tHfFkNFiz2L1wQtTiCEzR1EH8J5im/AZIlkNfO2pDUsdWaSJpNau1z/FwoUk +hvzV+NSSkIgOlEgnLogGMt/kVONC3V/8pt9x2joNEyB9XVxkQFo4uPlwRwhObx0C3DjXK3v+Jl Q1Ca4Kcc7vQn7akVFPi1M+pwVfRMTqHtMj4DoeptGnnVlu5K5cllUQi8Qx0iARpIF4Eibyh8rhF 11GRmS8gGUGXuEyQUdjL31SXVk74aZHGlAwlOkQQmHFCvZWg3OQVgkwrfjHaXsIA97wa8W+lLWI vt5tUAySYKfrveAfPS26D8QbnX5AMPDd7s75DQAIFZ/N555PYzCx2t9wXQDCMnOw95RL8Coq1J2 8th7Y+Bu5PQAQvcIdDDtUDo7vsUCYnF7Rkbcj+yrewBTy2l1D7yBSnUXOuicF5dc8i60cVwlS4+ Gtq99yWs8dYLEYw== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: AD2zGdR990MJ9I_ea3ToavrKD8GYG4od X-Proofpoint-GUID: AD2zGdR990MJ9I_ea3ToavrKD8GYG4od X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE0OSBTYWx0ZWRfX+mozEN+TlhYo toUreSFj5a12gkrLFRnhwsB1fdREGmZ8Du7UVI3M8eeEpI9D9lpSYTBUDvvjhtZIDRy/1b9Able jh2leFGNzoUy68LpQUK60nCYXecKi2iSwHX0G1IBDjeFwk+XtdghifjXfdficqvGb17MqeMDB18 jvewX4+u7ulXrvZbIIlQT8e1BHu0akt2awqWXPVH8fRBDESoitzsudbHY9Je57N0RIFb6+W8HSR bl1+TJPRcx3HtY7xFcoU5V5Ddnv4Od9DseO5of1VHfsvO4bc6/ZSQYTY2oNrfWkrPcVKQF8BmnJ 9MsRRYh5a+Kbi83bkuS9LfouDOF5Ljjk5wkgV8LQnC2oAkbq8/6jFuRffxWTh3pxjoHRyXkkcWp xzXV5Z1MIF9hZiRaXlOqdVVlxgERIbHVeqMs/03ywyW+kwabarD16POWdzI/gULwDZZMdlLuO6A jqjfexxBJo1Ij5IUbAg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE0OSBTYWx0ZWRfXyjSi4/FjliJd HoeZNvTwcjqg4YdnroAoCAA5IMBSgrMBj0a2k9ltUT8CSd7AqzsJ/DT+XtQnxFmUJ3X4aFVs+2F 7Iw7G2+Q/hqW1R/woWL2x9iRlw8Eg78= X-Authority-Analysis: v=2.4 cv=f/p4wuyM c=1 sm=1 tr=0 ts=6aa15c63 cx=c_pps a=1Os3MKEOqt8YzSjcPV0cFA==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=eho2TGTMVoPlayXLsvgA:9 a=QEXdDO2ut3YA:10 a=hhpmQAJR8DioWGSBphRh:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090149 Existing rules checked whether properties follow DTS Coding Style guidelines in respect of common properties and standard vs vendor properties, plus additionally it enforced alphabetical order within each of such group. The in-tree DTS does not follow such style at all, so this lead to many warnings. There is little value in fixing these warnings, because DTS with non-alphabetical order of properties is exactly the same readable, even though DTS Coding Style mentions natural order. Actually groupping properties logically, e.g. all supplies together regardless of their name, is more readable than pure natural sort. Relax the property order rules to the most important aspects (device_type, reg/reg-names, ranges, standard properties, vendor properties, status) and skip the alphabetical sorting completely. Assisted-by: LLM Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/dts-coding-style.rst | 5 +- scripts/dtc/dt-check-style | 137 +++++++++--------= ---- .../dt-style-selftest/bad/dts-property-order.dts | 3 + .../dt-style-selftest/bad/dts-property-order.dtso | 3 + .../dtc/dt-style-selftest/bad/yaml-prop-order.yaml | 5 + .../expected/dts-property-order.dts.txt | 7 +- .../expected/dts-property-order.dtso.txt | 7 +- .../expected/dts-property-pairing.dts.txt | 6 +- .../expected/yaml-prop-order.yaml.txt | 1 + .../expected/yaml-prop-pairing.yaml.txt | 6 +- .../dt-style-selftest/good/dts-property-order.dts | 3 + .../dt-style-selftest/good/dts-property-order.dtso | 3 + 12 files changed, 91 insertions(+), 95 deletions(-) diff --git a/Documentation/devicetree/bindings/dts-coding-style.rst b/Docum= entation/devicetree/bindings/dts-coding-style.rst index 63648db377e1..441436b7fa80 100644 --- a/Documentation/devicetree/bindings/dts-coding-style.rst +++ b/Documentation/devicetree/bindings/dts-coding-style.rst @@ -135,8 +135,9 @@ The above-described ordering follows this approach: 3. Status is the last information to annotate that device node is or is not finished (board resources are needed). =20 -The individual properties inside each group shall use natural sort order by -the property name. +The individual properties inside each group shall use usually natural sort +order by the property name, with exceptions of logical grouping of propert= ies, +e.g. supplies. =20 Example:: =20 diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 9fcb2eeaf7fe..99b22364d866 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -714,65 +714,40 @@ def check_property_name(ctx): yield (dl.lineno, f'property name "{dl.prop_name}" is usin= g discouraged style') =20 =20 -def _property_bucket(name): - """Return the canonical bucket index for a property: - 0 device_type +def _property_bucket(name, is_root=3DFalse): + """Return the canonical bucket (group) index for a property: + 0 device_type ('model' in the root node) 1 compatible - 2 reg / reg-names + 2 reg, reg-names 3 ranges 4 standard properties (no vendor comma in #-stripped name) 5 vendor-specific properties 6 status - Plus a sub-key inside the bucket for fixed slots (device_type, compati= ble, - reg, reg-names, ranges, status). 'standard' and 'vendor' return None f= or - the sub-key, signalling that the within-bucket key is computed by - the pairing rules.""" + Properties sharing a bucket compare equal: their relative order + within the group is not checked, only the pairing rules below + apply.""" stripped =3D name.lstrip('#') - if name =3D=3D 'device_type': - return (0, 0) + if is_root: + if name =3D=3D 'model': + return 0 + elif name =3D=3D 'device_type': + return 0 if name =3D=3D 'compatible': - return (1, 0) - if name =3D=3D 'reg': - return (2, 0) - if name =3D=3D 'reg-names': - return (2, 1) + return 1 + if name in ('reg', 'reg-names'): + return 2 if name =3D=3D 'ranges': - return (3, 0) + return 3 if name =3D=3D 'status': - return (6, 0) - return (5 if ',' in stripped else 4, None) - - -def _property_bucket_root(name): - """Return the canonical bucket index for a property: - 0 model (for root nodes only) - 1 compatible - Plus a sub-key inside the bucket for fixed slots (device_type, compati= ble, - reg, reg-names, ranges, status). 'standard' and 'vendor' return None f= or - the sub-key, signalling that the within-bucket key is computed by - the pairing rules.""" - stripped =3D name.lstrip('#') - if name =3D=3D 'model': - return (0, 0) - if name =3D=3D 'compatible': - return (1, 0) - 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 (6, 0) - return (5 if ',' in stripped else 4, None) + return 6 + return 5 if ',' in stripped else 4 =20 =20 # Declarative pairing rules: each is a callable # (name, all_names) -> anchor_name_or_None -# If a rule returns an anchor, the property sorts immediately after the +# If a rule returns an anchor, the property must be placed after the # anchor. Rules are tried in order; the first match wins. If none -# matches, the within-bucket key falls back to natural sort by the -# #-stripped name. +# matches, the property can be placed anywhere within its bucket. =20 def _pair_pinctrl_names(name, all_names): """pinctrl-names follows the highest pinctrl-N in the same node.""" @@ -787,8 +762,7 @@ def _pair_pinctrl_names(name, all_names): def _pair_x_names(name, all_names): """Generic -names follows its owning property. The owner is usually plural (clocks/clock-names, dmas/dma-names, - resets/reset-names) but occasionally singular (reg/reg-names is - handled by the fixed slot above; this rule catches anything else).""" + resets/reset-names) but occasionally singular (reg/reg-names).""" if not name.endswith('-names'): return None base =3D name[:-len('-names')] @@ -812,33 +786,27 @@ PAIRING_RULES =3D (_pair_pinctrl_names, _pair_x_names, _pair_address_size_cells) =20 =20 -def _property_sort_key(dl, name, all_names): - """Sort key for a property among its node-body siblings. - - Format: (bucket, within_key, tiebreak). 'within_key' for - standard/vendor buckets follows pairing rules: a property paired - with anchor X sorts as if it were X with a higher tiebreak.""" - if dl.is_root: - bucket, fixed_sub =3D _property_bucket_root(name) - else: - bucket, fixed_sub =3D _property_bucket(name) - if fixed_sub is not None: - return (bucket, (), fixed_sub) - +def _property_anchor(name, all_names): + """Return the property this one must be placed after, or None.""" for rule in PAIRING_RULES: anchor =3D rule(name, all_names) if anchor is not None: - return (bucket, _natural_sort_key(anchor.lstrip('#')), 1) - - return (bucket, _natural_sort_key(name.lstrip('#')), 0) + return anchor + return None =20 =20 def check_property_order(ctx): - """Properties within a node body must appear in canonical order: - compatible, reg(/reg-names), ranges, then the standard group, then - the vendor-specific group, then status. Inside the standard and - vendor groups, pairing rules apply (e.g. -names follows ); - everything else falls back to natural sort by the #-stripped name.""" + """Properties within a node body must be grouped in canonical + order: device_type ('model' for the root node), compatible, + reg(/reg-names), ranges, then the standard group, then the + vendor-specific group, then status. + + The order of properties within one group is free, e.g. it does not + matter whether '#address-cells' comes before or after 'clocks'. + Paired properties still keep their relative order: -names + follows (clocks/clock-names, reg/reg-names, ...), pinctrl-names + follows the pinctrl-N states and #size-cells follows + #address-cells.""" lines =3D ctx.lines for i, dl in enumerate(lines): if dl.linetype !=3D LineType.NODE_OPEN: @@ -856,16 +824,26 @@ def check_property_order(ctx): if len(props) < 2: continue all_names =3D [p.prop_name for p in props] - keyed =3D [(p, _property_sort_key(dl, p.prop_name, all_names)) - for p in props] - for k in range(1, len(keyed)): - if keyed[k][1] < keyed[k - 1][1]: - p =3D keyed[k][0] - prev =3D keyed[k - 1][0] - yield (p.lineno, - 'property %r out of canonical order ' - '(should sort before %r)' % - (p.prop_name, prev.prop_name)) + buckets =3D [_property_bucket(p.prop_name, dl.is_root) for p in pr= ops] + findings =3D [] + # Group (bucket) order + for k in range(1, len(props)): + if buckets[k] < buckets[k - 1]: + findings.append((props[k].lineno, + 'property %r out of canonical order ' + '(should sort before %r)' % + (props[k].prop_name, + props[k - 1].prop_name))) + # Pairing within a group: the anchor must come first + seen =3D set() + for p in props: + anchor =3D _property_anchor(p.prop_name, all_names) + if anchor is not None and anchor not in seen: + findings.append((p.lineno, + 'property %r must be placed after %r' % + (p.prop_name, anchor))) + seen.add(p.prop_name) + yield from sorted(findings) =20 =20 def _check_redundant_whitespace(dl): @@ -1161,7 +1139,8 @@ RULES =3D [ 'property names use only recommended characters (see DTS Coding S= tyle)', check_property_name), Rule('property-order', 'strict', - 'canonical bucket + pairing + natural-sort order of properties', + 'canonical group + pairing order of properties (order within ' + 'a group is not checked)', check_property_order), # See also check_redundant_whitespace() and check_value_whitespace() Rule('redundant-whitespace-strict', 'strict', 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 index ebe561e38766..eb36daa4fe72 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts @@ -43,6 +43,9 @@ interrupt-controller@10000 { <4 5 6>, <7 8 9>; compatible =3D "example,intc"; + qcom,calibration-variant =3D "foo"; + clocks =3D <6>; + qcom,opp-fuse-level =3D <1>; }; }; }; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso b/sc= ripts/dtc/dt-style-selftest/bad/dts-property-order.dtso index 64604fa6b8c3..b2e564f2af2b 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso @@ -44,6 +44,9 @@ interrupt-controller@10000 { <4 5 6>, <7 8 9>; compatible =3D "example,intc"; + qcom,calibration-variant =3D "foo"; + clocks =3D <6>; + qcom,opp-fuse-level =3D <1>; }; }; }; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml b/scrip= ts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml index bf1480e97209..4d8a50d0e35a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml @@ -26,4 +26,9 @@ examples: device@1000 { reg =3D <0x1000 0x100>; compatible =3D "example,test-prop-order"; + + interrupts =3D <1>; + qcom,calibration-variant =3D "foo"; + clocks =3D <6>; + qcom,opp-fuse-level =3D <1>; }; 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 index 0ab832ccf07a..155b072f0ac2 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt @@ -6,6 +6,7 @@ bad/dts-property-order.dts:21: [property-order] property 'd= evice_type' out of ca bad/dts-property-order.dts:30: [property-order] property 'dma-coherent' ou= t of canonical order (should sort before 'status') bad/dts-property-order.dts:35: [property-order] property 'compatible' out = of canonical order (should sort before 'ranges') bad/dts-property-order.dts:45: [property-order] property 'compatible' out = of canonical order (should sort before 'interrupts') -bad/dts-property-order.dts:50: [redundant-whitespace] extra whitespace bef= ore { -bad/dts-property-order.dts:52: [property-order] property 'model' out of ca= nonical order (should sort before 'compatible') -bad/dts-property-order.dts:57: [property-order] property 'model' out of ca= nonical order (should sort before 'compatible') +bad/dts-property-order.dts:47: [property-order] property 'clocks' out of c= anonical order (should sort before 'qcom,calibration-variant') +bad/dts-property-order.dts:53: [redundant-whitespace] extra whitespace bef= ore { +bad/dts-property-order.dts:55: [property-order] property 'model' out of ca= nonical order (should sort before 'compatible') +bad/dts-property-order.dts:60: [property-order] property 'model' out of ca= nonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso= .txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt index 9f2a00916329..48c020d21b64 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt @@ -6,6 +6,7 @@ bad/dts-property-order.dtso:22: [property-order] property '= device_type' out of c bad/dts-property-order.dtso:31: [property-order] property 'dma-coherent' o= ut of canonical order (should sort before 'status') bad/dts-property-order.dtso:36: [property-order] property 'compatible' out= of canonical order (should sort before 'ranges') bad/dts-property-order.dtso:46: [property-order] property 'compatible' out= of canonical order (should sort before 'interrupts') -bad/dts-property-order.dtso:51: [redundant-whitespace] extra whitespace be= fore { -bad/dts-property-order.dtso:53: [property-order] property 'model' out of c= anonical order (should sort before 'compatible') -bad/dts-property-order.dtso:58: [property-order] property 'model' out of c= anonical order (should sort before 'compatible') +bad/dts-property-order.dtso:48: [property-order] property 'clocks' out of = canonical order (should sort before 'qcom,calibration-variant') +bad/dts-property-order.dtso:54: [redundant-whitespace] extra whitespace be= fore { +bad/dts-property-order.dtso:56: [property-order] property 'model' out of c= anonical order (should sort before 'compatible') +bad/dts-property-order.dtso:61: [property-order] property 'model' out of c= anonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-pairing.dt= s.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-pairing.dts.txt index dad3d8485012..976471ca8068 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-pairing.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-pairing.dts.txt @@ -1,5 +1,3 @@ # mode=3Dstrict -bad/dts-property-pairing.dts:21: [property-order] property 'clocks' out of= canonical order (should sort before 'clock-names') -bad/dts-property-pairing.dts:25: [property-order] property '#address-cells= ' out of canonical order (should sort before 'interrupts') -bad/dts-property-pairing.dts:27: [property-order] property 'pinctrl-0' out= of canonical order (should sort before 'pinctrl-names') -bad/dts-property-pairing.dts:28: [property-order] property '#size-cells' o= ut of canonical order (should sort before 'pinctrl-0') +bad/dts-property-pairing.dts:20: [property-order] property 'clock-names' m= ust be placed after 'clocks' +bad/dts-property-pairing.dts:26: [property-order] property 'pinctrl-names'= must be placed after 'pinctrl-0' diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.tx= t b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt index 578df7209170..bb0dd5db5135 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt @@ -1,2 +1,3 @@ # mode=3Dstrict bad/yaml-prop-order.yaml:28: example 0 [property-order] property 'compatib= le' out of canonical order (should sort before 'reg') +bad/yaml-prop-order.yaml:32: example 0 [property-order] property 'clocks' = out of canonical order (should sort before 'qcom,calibration-variant') diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.= txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt index 025ec872f1b0..dcdee1cff506 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt @@ -1,5 +1,3 @@ # mode=3Dstrict -bad/yaml-prop-pairing.yaml:30: example 0 [property-order] property 'clocks= ' out of canonical order (should sort before 'clock-names') -bad/yaml-prop-pairing.yaml:31: example 0 [property-order] property '#addre= ss-cells' out of canonical order (should sort before 'clocks') -bad/yaml-prop-pairing.yaml:33: example 0 [property-order] property 'pinctr= l-0' out of canonical order (should sort before 'pinctrl-names') -bad/yaml-prop-pairing.yaml:34: example 0 [property-order] property '#size-= cells' out of canonical order (should sort before 'pinctrl-0') +bad/yaml-prop-pairing.yaml:29: example 0 [property-order] property 'clock-= names' must be placed after 'clocks' +bad/yaml-prop-pairing.yaml:32: example 0 [property-order] property 'pinctr= l-names' must be placed after 'pinctrl-0' 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 index 3d847cc9fa3e..288fcfb9888f 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts @@ -40,7 +40,10 @@ soc@0 { interrupt-controller@10000 { compatible =3D "example,intc"; reg =3D <0x10000 0x1000>; + clocks =3D <6>; interrupts =3D <1 2 3>; + qcom,calibration-variant =3D "foo"; + qcom,opp-fuse-level =3D <1>; }; }; }; diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso b/s= cripts/dtc/dt-style-selftest/good/dts-property-order.dtso index 5ae78541f68b..60c68b3f908a 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso @@ -41,7 +41,10 @@ soc@0 { interrupt-controller@10000 { compatible =3D "example,intc"; reg =3D <0x10000 0x1000>; + clocks =3D <6>; interrupts =3D <1 2 3>; + qcom,calibration-variant =3D "foo"; + qcom,opp-fuse-level =3D <1>; }; }; }; --=20 2.53.0