From nobody Fri Sep 25 07:23:39 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 233DE402422 for ; Tue, 15 Sep 2026 17:04:02 +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=1789491844; cv=none; b=PF1snJCWBqNB8nt/+U9uhWFrSuuJeMspPf5VNdnqQ6hlvBj3HPB13PYeuhOU3nP19dGroRcROOSKFo0lmbCVR343QALQTuZJBpiXcmO2eXl1R/KFG4mfeohWjGXFVSuEdaWg/nuAUvqPnEJq5hM4ZFRByprhB4/mdUV6LvyAfhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789491844; c=relaxed/simple; bh=w3zTKteM9+dXP6ekYmOuIUo7NZB4TZ5SyaeehZjbXRc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mt0s1H3oY/ZZGX5NhDrioi/69L/Tp1+DIxSDhoSeslvfr+bb77EeLx4K+TjQ57Dfb3fIREA94Sf+YF91RgQ6oaxMb5MWyMdrlAD5DBRqTeMrAw3P590E9QxcWDfw9gKUpBYi0zwYDCtl8FoFzsAFJvD6RWrGqgMcIYuVxzLcvNE= 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=hY4VMplV; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=f5MGWl0/; 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="hY4VMplV"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="f5MGWl0/" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68FFAX3F291063 for ; Tue, 15 Sep 2026 17:04:02 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= nUHktJGTHh8bAwUtVbzFPaSsYpwxlbXpnYldJaXVb2g=; b=hY4VMplVo0qbPKHH O6jCP9DDDJp+Wn36K6xBsaX6R7eSrekgd8s38bMdd2gCv06RU6pqNnuyXyEODxEu nRzl2smvVEcNRUfcmQvobZXBTjxV7w/JkDs16I9m0wA8FVCsr/0uTjQno4L1RiGV yWwEt69zxJFP86s5n8FcHJVtJlzjhuXobfn6Ue/VTSGWMcwSZoMdE9dYc8UIBtl6 yda9gAajV115d6V0x7fcWSbVctty9DdrriVyk0yPHrvEy2062j5aqrY0gyLZccBu tAPoNCRsBuMOcWr+dB8s1HNNmulwy4xFIEpyvGudptVVwR7sjvawZbFkc3e1FlIL 64b3dQ== Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpyux33f9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 15 Sep 2026 17:04:01 +0000 (GMT) Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-5c82c2e9761so1316792e0c.0 for ; Tue, 15 Sep 2026 10:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789491841; x=1790096641; 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=nUHktJGTHh8bAwUtVbzFPaSsYpwxlbXpnYldJaXVb2g=; b=f5MGWl0/gFhwaJIzcX+EsNMF/iVG4vG8zyzaAkhAjBRCm2zPUg/9NVNGm463ubhCXJ XM49CZog/HfxgyuPP2zxltWugDChnTVAX4XhvBdvDO0M6SQVnYv2xscstdUVDP1r3GTl gya6mpzKgRTlKYxrBlcPziCA6Ek8h04ux7pAa9fQOESB8wwZ0rcz7hrRGecZ/KPtKGVl O/96MGIt2r+b9a1V+/yBLtU2rHJmgyGYSNL5Rn3PuzAPTuU3BGcNuPfVoAga7b+wX1fF cC2qIi9IpbihTZ2U8VYwKQVDw1GVET+FnevyPw4eZ+AiPnoHzDUu3d0D1USKzbQ5kxfx GUOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789491841; x=1790096641; 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=nUHktJGTHh8bAwUtVbzFPaSsYpwxlbXpnYldJaXVb2g=; b=VN67rxOaxsesfIXLIYVZooJHaKhJYyZkTGQIcmnewAhm3HuT+9PdFf+GDFoorY/nyW EgZZ5GSZlLrlAU3czyQ3un3pWXLxFOu3iutCQIGHv1owYhue8SYvcnrHqspicBHgYueo XWGNft1kwTnU/eiXeHJ1A8+StLNU+8IJaGNLm5zYBn5SOxVIGvb7hHwO5s+7njkqvmh8 tdzwlXvVWZCSYwO8QQrowdurUYcdVmSdJgg3GOVxRmYLDUQAo1J8hbpd/4+S80NUtNIU NjAG6OBzigyfQSs8OYlnhS96EYcGtp+8FNCltVlZQ+IX7qnE4YaCC1x2F05Xruw68v/L WEGw== X-Forwarded-Encrypted: i=1; AKwUvBys8RzUmjTBzvV4xJNs4C6HnKnLKY0S/EAGwGms6W+fIGXmXZHU1mUSCamGYgNa9UaiC4asYEna1Q6OKno=@vger.kernel.org X-Gm-Message-State: AFuF++ln5MTukKfS9voTpmKW1jSZn0LBLLqsf2H8fdg4gyrchw3bLBNf A/bVS6rLyJAPophpV+0zIOe/Ift+wx48aiPfAuKwpp73zedV8ZrxU3ByCXaGdU5biAM6bMMesLm L4nH7Wp7kumeb8cYoMRId3ZMg426dnZocUjOUW831E13s4Cxrvco/OoLLFqndkXk+6wQ= X-Gm-Gg: AYBFou2TiKa2jcW+G/5Hf6Ee+a47kUK8lyaPMdchHuL0chX+OXDHMz6YMClZyv+MGbs nYJxK0oaYHxbg7UWhWtICViB5OdHeAMwJlf2a/6u4Bat60HkqjWmqydjZfGI9C9x3BE2GZvsWqp hG5EHBQv05Sr8eKBqR/rMxZ8biyal+mu1kRnK5Q+htfiadxOXOStMaZFSOJ5XXeve45spgAP2/M SDy9Lmc13/Z1RLxmlWaxnxcm1+DMBAN0779wQhOr64DuUI40IDKqYjptS0PJm9W1owR2vZBWJsO UfPj9D8fbmVMVzAlcvDpY+9q1tR7ku9/VGx4ZCwgq8F0BsvFDKvOSYt1djd3VTtnYBJBxXMvaJM 8r5iVDEcStMaKHWHETPaBR8o= X-Received: by 2002:a05:6122:d21:b0:5c8:2dc9:f8d2 with SMTP id 71dfb90a1353d-5c981898b18mr12591368e0c.0.1789491840875; Tue, 15 Sep 2026 10:04:00 -0700 (PDT) X-Received: by 2002:a05:6122:d21:b0:5c8:2dc9:f8d2 with SMTP id 71dfb90a1353d-5c981898b18mr12591260e0c.0.1789491840453; Tue, 15 Sep 2026 10:04:00 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf27df9sm391286f8f.19.2026.09.15.10.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 10:03:59 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:45 +0200 Subject: [PATCH v4 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: <20260915-b4-dts-style-checker-continued-lines-v4-1-5b8e09b11ef2@oss.qualcomm.com> References: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@oss.qualcomm.com> In-Reply-To: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@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=w3zTKteM9+dXP6ekYmOuIUo7NZB4TZ5SyaeehZjbXRc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqqXp2c+qFIDZzEzr6deLeF+TnkVbedSeoB77Ag FeLpozrm6uJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaql6dgAKCRDBN2bmhouD 1/JPD/4uJKpDQhsUfOFzY4TwpDLEWMi5UtiohBi3nqgaDFo6WtMuA8CDpqW+dLQA2w4dnIoHqCu 74YtcbQTu2DwTy+9gNquIhnbcfVqIjAC/MnprReZ2Uih8PbszD0qrrepXXu1yD9N6IMqGNa9URd Tq64kPlekBYcTIXjtDDGRDg+x0qAN0Hc4JrAM/ZB68jB7OM7L4ne+++FXy5U3uFdKwvYm4IYJlT CpgXAM1wduDXxnImdZDRwzWpjauSk1h8ZeUevylbi9lSpIIM/XR6Z6sPlL2yyEOJZ7dpcfLTvLA SsCxDy0dObu4gkDFDuEule4aVLMc1v/nNrVIo7soUjUIcqiF9I3N+i626OwmfUPCZBO/fveFARd zjSnxsreMfbRJolPH+s603p/Zy+SPcBiHM51WoQUkipCEjDaDqyxvgWJ1QlBYTyN1r1NFAYslSW F14zNNr+ESlUjjwu3mvxylNID49Ji+v8WNSE2YhNdF7tP1kQbVD5C2Uo4ZNUjgb/JXcotwOXgMr y+/7ASrCvsf3nUuRlDXi9C09DtdF6NWeN9ACp/ec/N8iqGRAzYmYp48THd2DHPfLaakZXwgmI5U 1fqCwXKO/Lk6pF+pL7YLdnW+KkNvVx5ROuJvHmOcCYyJrddomL9BSovh9gvuD675MByLwZZWqSw xbLcXcCYGATVP3Q== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX1YLLHUuuI9Bh 1e7wHnckXuiWB91yv0UNvQ9q/b4FWfMtDtSFAnCuT+RmOf5zPJg2zJOzVT2YCy08H4KLUZc6EVn y3sscJ5+Z4hEPakCL5zxcfA1qviHVY2E96p7NE2xAOW+SfEW7RolNysRJP1fCYdlBk8y37Jb168 JzYCbUMIbnqxiTV1yeKWGD1eiVl9KbTqAA54SFTBfqnEOs9uahYsHLbhzuh2LvsC3RAA1PyEs3e yccq2kmGpZ65b0RmLW+nsMnSaoMw6/7SK5Pvq1FWdc4l4yeJ2rmzha9eltwghrOkDTBf/Gp/uMf mW650jziQ6XDacJxOQ3ELu8LPoMftEfCZx64MYbjjIWqf2CAln/LtHVJOxIXHvvYtaoVLLJv6t7 g5BlBtpxfDrVmw46/n24wY+ZdFWw4EpGzcmy2ekECNl9+TX4eWBdQE4nyMLnLebKTmdBLov+/2L 3L3hthGTnP5PH0JLwig== X-Proofpoint-ORIG-GUID: MbqdKoOWdL92zvyae1l0QuHRk__C4GRQ X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX+cGhuQKhaTQf ODvv/4Fr1cWtQMO0Ue+wx1x89WyqYvu3eyPxMKqlk5XBnPXN79TxbI2UTw1ALBRhvgoJtaUMc6V X5p26I0iK5LAGiFTiGrbXk5ma0JoN88= X-Proofpoint-GUID: MbqdKoOWdL92zvyae1l0QuHRk__C4GRQ X-Authority-Analysis: v=2.4 cv=QYLzLcbv c=1 sm=1 tr=0 ts=6aa97a81 cx=c_pps a=wuOIiItHwq1biOnFUQQHKA==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=SU40fdrgiSb2mxkwluUA:9 a=QEXdDO2ut3YA:10 a=XD7yVLdPMpWraOa8Un9W: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-15_04,2026-09-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609150249 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 0ebbe658b893..2d0463c626e5 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 07:23:39 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 9575342BE95 for ; Tue, 15 Sep 2026 17:04:04 +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=1789491847; cv=none; b=snAGEU5xSecsHt/1SuBXHB1oy6GqRN1fc9QkswED8dqEVCi3M42nT8aD/xmLWEdAJzO/965bK144phT70b+mye4sUvDR8fXvjeu9uw9HNZyicqrNEo235nifwT/571Wmr+23G4k9jgf12aPHXc5sYeAQezeszqiXtHHNa5l4gUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789491847; c=relaxed/simple; bh=xtfVDB+vdhX1n/Ql0XY2Hca90HSlWDNnO9Ce7AFybtU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RIEqqEXGBXZdjgJfMbvaBzrVHyrAEw2nfYUQUX67oPoYI+oB/SQTcrSeffMUdW07H+soPhR7+xklrJ93F247TRwW9WDg2MDZWyy35pDWBuQW4KCHn5IKjlWueAWVO4Gvw8WLFxOzVsLB7pthBvoKL+fd8BA+OatN8CbhfTtguKI= 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=ZwvQsEOH; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cMH6ZgCU; 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="ZwvQsEOH"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cMH6ZgCU" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68FFAqrZ125509 for ; Tue, 15 Sep 2026 17:04:03 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= 2wC/0i74abjzvudGIqaEmY6ilpuMA0d+d0ZW+7rV6F4=; b=ZwvQsEOHzwYeG2Cn lle1HZnmoEThf5v0c2UAt/1va8mBbmaQc8HOZRX2LLzIxTDMxshQLAfWi+flewm+ vyL8wviiUhbu6+WS+bQpajpcveB1dIp0Mx/gmbfOGdsItK/38Agonuon6odWoIIY VJg9vBj39xsUHh98N4msm6ag00Kicie1X8x8wjArbeJQeAjljFpMS8e3pyqMbsTq hLt7qXJguRWz9hyrAVcjjFeTO5VvY0EX1KyI+RyjNIxIjlsJdBgOi8uFuOgt2fxh sC4QxiOqTqtfScXNI7xl8TWJoLUEppJLbDqav9XhsUW65If09mzF6qj3rJF2N5I7 v10mzg== Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gq3xttd1x-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 15 Sep 2026 17:04:03 +0000 (GMT) Received: by mail-ua1-f72.google.com with SMTP id a1e0cc1a2514c-9806756ea40so3866193241.1 for ; Tue, 15 Sep 2026 10:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789491842; x=1790096642; 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=2wC/0i74abjzvudGIqaEmY6ilpuMA0d+d0ZW+7rV6F4=; b=cMH6ZgCUmczow/MXveRdW9+WvITtUIZTJs17XAUpafLMCjamHzTpY2yoi7gzJX6uDo VZFF+dB9mM6F+Mzd9Gvei+q0otdzJAK67TAwH9BJsh7dxQKJrN6z23GkhSpRxqX7jwxE 8U37vJMK+AiB8gSyMWdGsB9pvK5UCGj3YtGrimVFLgpI9EHsR6OT33lcOW0icu2weMhs RhFKTe/KbfrIzvUHnd/7cq4iAJxdYxUqNlANvEyplhGp16zXTdlDtNfxTliTtB34audw l5D7nPkf06bxeJtM88nqc3FjKDMqtjNu1CW7UNS03YPzBgWodVfFXVmIkpGiJ8xERXuA i8JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789491842; x=1790096642; 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=2wC/0i74abjzvudGIqaEmY6ilpuMA0d+d0ZW+7rV6F4=; b=SugeDzjKG0hEjYAt5WiL7rnwrK2HNljtY42hWuNmXYI6Igont+kJc91VYX+7ayTtql xWix1gu7f/DTlL0K2jxF9gYv/pHDkMSTCk1WMM4qD4EzykL5bNGerqhtSDanB8HJipBX IhvWw2IygEhUFrvAyKbgJwNjf1xIxvr4bVTuVrLIa1JKDeYvp1XFhjxqZIQj0aQ64Xme Z1Lffaw2ZtGd9DelBVzXeSZMTlwGfecP7olK8Jrd8VL2AhJiafgs0LVwBEcB3qNgmzMU +BTAZ6BTMqyrVCUZ4aUBfhdEV3N+Z7uY7obpZXzRZ6wr6iLC+Hbhd8tJEH9SH0k5rtnd f2lQ== X-Forwarded-Encrypted: i=1; AKwUvByg40R0MKUaxW2b8wmfXPc/9EV1Bkh7RLHy9J8z8DznuPjJ9+FnN/3b/u0JSrWjKwhE4YIOFGiS1HRDh6c=@vger.kernel.org X-Gm-Message-State: AFuF++mtMq/O8nJgjRssMELIfUdMlpuByDoFHOOFgdSLI508Ha7JWwmh WGnMjtDFt+dj3QtFKN7VZmM5v920D8vdb3fijgcPFXsKfKXFpkzC+piKV+Bxft/kj6hBonABkAH pvwy7ZmQSLvL7vrrZd8wx1ij/W9nH3obZSefDyUX8calzGJyOdkguX1Eo5myrrzSDA3w= X-Gm-Gg: AYBFou3h4MI4SU2OR3QTu5YrFOj5kLE1+xHXFpo5MMIZt6cp4Ly4kNOS1sLr4z+laqB afsoMSVZUYD4X0DQ6XrNH2FoUuQGkymLKF4eC7CgnGSCVbcPRKWwhSZ93ydrI6wuKXcat67JjT2 U3qfIFqMYUIIm8pvD8W1nrTBVL3m+Q/tQ+5vkZFtXHN8qocCByN7x8y1gg8ks7SIqxCRQwDlYuw 89Ex4pWOebDHmAWhavf5CaZ03lWCqnw6mooG0tPDqzVD7hN2EZREf/CLZpZ7dTd4xrbZe/DFBrI Ss8IZetHHywMFmQB6LiuGc5/ZbW1eHhsMz3k+0erdtdyC6vi5BZ3UTWJpRGfMOYKyRA/DOYQ8K7 tNMOoWGUx8oPEkeKjlE48iaw= X-Received: by 2002:a05:6122:6401:b0:5c9:983e:79e4 with SMTP id 71dfb90a1353d-5c9983e93a8mr666717e0c.7.1789491842606; Tue, 15 Sep 2026 10:04:02 -0700 (PDT) X-Received: by 2002:a05:6122:6401:b0:5c9:983e:79e4 with SMTP id 71dfb90a1353d-5c9983e93a8mr666649e0c.7.1789491842255; Tue, 15 Sep 2026 10:04:02 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf27df9sm391286f8f.19.2026.09.15.10.04.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 10:04:01 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:46 +0200 Subject: [PATCH v4 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: <20260915-b4-dts-style-checker-continued-lines-v4-2-5b8e09b11ef2@oss.qualcomm.com> References: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@oss.qualcomm.com> In-Reply-To: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@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=xtfVDB+vdhX1n/Ql0XY2Hca90HSlWDNnO9Ce7AFybtU=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqqXp2WM4JJQNSH2RzIJ1h7dfV7/iAkRFBCSmSp JUFM3w2OciJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaql6dgAKCRDBN2bmhouD 14JSEACSyZyTkfL3i8/MxfguupqRACcSnvAuKAZ6A+xtnLpjaKpLB8F8PZ8zSfbCIev73FZ5Urk 73ieD7+CpwndVKx/D7yvLg0iJGq+PR9Bl4TdCH1Nf6+ZyOaL6gsD1nFd5lBpY4vLAhVF2SVIG1x RPwSzJoUk3xKVY5LxbDJWh8EYqaZru7WnO/hkbRGt7qgJQRF2HuMZaE5y8XSL8c2gyriyWhe/BA 7eJN8eGOVeB7Du6Ti4uGWRGq3jPYcIbgkwme7iMQmWpNQ5rCKixZp3i1yPlOmKw24qkw+vrmMkE fgodacVTzrf5d0SRJeSYLleR887bDzJU7HhpiI5SpPMEM9MZpVVgtW0VncAXwQx2ETt2nu1MOrR uN/VTRxbp61KXk78NSc/rdLgMSBwD4Q0tVJVPsePs2v/XMATxC9gDNLYLbxH9rGODKixZAFzHVU RsVF5ZwkFiKYQe1xLSxmB1qbpuSvNjr6rMrZwKzMxBaxokY7Rd3g4qrVTyedzsF7C0hUauM5Jk8 mBXBs8aOKGz884t/dTIIBajcBgXqJS5i8I3Vv7VZzHqX8aENsrQ01/qdBvKOASpaDp46+kS/1nW lTYLDU3kuJmG+3gP2Ja8ZaFEtKakdG750vrcon1rRm6s+dn2WXe22toluwPNYjr5ajO6fzVqYva ykArcjKADr9kHwA== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: tVW_ui2SEbRicZxzZs-eIrfoePC0xEl3 X-Proofpoint-GUID: tVW_ui2SEbRicZxzZs-eIrfoePC0xEl3 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX39eA3SGffr9P z60FHI/EAQDDQTrEXT9oflYv8jzy/zK34wVP2hxf2e+d0UQeMTQ9IOBWHu6hNPXzXklGpFBBdSN E43WAhYm5FCMWuL3bMPwXvnAOMCYaGg= X-Authority-Analysis: v=2.4 cv=As97T+9P c=1 sm=1 tr=0 ts=6aa97a83 cx=c_pps a=ULNsgckmlI/WJG3HAyAuOQ==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=jHdmtohXv_5nRK-EuSoA:9 a=QEXdDO2ut3YA:10 a=1WsBpfsz9X-RYQiigVTh:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfXxrs8YoXPwifA XBmNXI1XPoSPlm4Qxv+p1a3gXgIFNkDbj/vHeXZphszw+Fz4vYnmG6zewL//wazchU11pPHgPJp oJ3Iwu7h+dhk2oc5U9aRvwZJMBwa8cFSdtJ4D9vpaT3pZdKHCj/7i4Fy6AjCS9t8EwjBbRjaJC4 liNX55IAzojENh4Bc9Cz90dLwQjcN9VsuuihMfqwI2jvTYo6VK2PAp1ytFOnsILmTBq5ryDI5sK zPBEP3vrijuPigRxI8+0n+w5nlyNX46/P/a8RpW2Nzk77AW2EYD0aYZFDm2TA76RzQ0/EFRAcl+ eIqkCrOBaZ7VI8vKL5nIFsEyWtPD3Z3AJ+oWVzK6ky+Tc1Vk+BiEt2ZjF7333/l2jyfRoU6tdGm n4yeCUkY/G284iBxj8Df7cb/RQxBeJIllzD/pADyRv3ZTnAOHbudnFyvemy1tU1kuihRBpdZQyf In5VhBFeBEmpgRpMzew== 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-15_04,2026-09-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 bulkscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609150249 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 2d0463c626e5..525d9df6c11b 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 07:23:39 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 7926B43801B for ; Tue, 15 Sep 2026 17:04:12 +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=1789491858; cv=none; b=GqbYkuE/zGPgYfNoWcupyabjQkwI5IznRB+1q/pPf3ZMlwGhqVqTNVTH8cXlSoNtDvnbVj4X1Kqw6CIvDoG/T58uNThLniYC7qR9Ii7yaLwNd7JMUqtDQn6PGT8/LZTGdavDOty/O/moYBGz2nC5RMw5ly4rbVxYlg4BpDhMuCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789491858; c=relaxed/simple; bh=IH1W9IlOK+nkzbQ00GnaQXjHG0Qc0Siw6521Fcp0sS4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OCoOHd05p3kUsrVSz3HunLU5HNB7t1HzeQ7OqbnUJBQIAqX61HtbnmGQF2WiT9CypPKTwB2HuLVgFxCeQdd6D/EU+0jqf/9qCNMUHv0+CjTETMUUFNxAq3D3H6Ko20Grxqfr0Heewcylip60LP5hEOhsAIq3AgEYqen3TZZdPqk= 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=Jf/Oa53k; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Zf0nvziQ; 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="Jf/Oa53k"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Zf0nvziQ" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68FFAYLN3958815 for ; Tue, 15 Sep 2026 17:04:10 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= 6Q+R860tRKkGNSd01+QxlRg3ifR5jM01Z5ifrXiDEe8=; b=Jf/Oa53kF8gCMRYA gpGp/H2GSz7tVV2rXvjn0HUCNtC56niht7hf69n5TYHxeIyEY2ckGJIMVZSGFNMK SKsX5k3OgZwLPFCIwh5QvAIgqMIPId9mOaaRMhUcHIdt7g3yNjlGCXGXFwel86us 8ysuf4Y5zWTvixTg6ocen2riCNoapLifymo3IkVLrp/FurBGshIPbQOTUJX529yf EhJR0dbSkiB3+QgR+WJBsjXIR6/b72s+Ux83qZbPkVR7H5Ghc89PDbi8n4+TRzE4 rppN9c7kUoa3G58qHJu/9SbrZ1Nmn28wDAe/KI0sp/VWaf8lnAa/zhd0L1pbzXK9 Fhpltw== Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gq2y2j825-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 15 Sep 2026 17:04:10 +0000 (GMT) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-90e8472ee1eso101592826d6.0 for ; Tue, 15 Sep 2026 10:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789491845; x=1790096645; 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=6Q+R860tRKkGNSd01+QxlRg3ifR5jM01Z5ifrXiDEe8=; b=Zf0nvziQV6bRRrdpsYxaXRweywurofa1DQB6VSvCUEHBMT1f9CsGM2ga/SOqNJxtfa mBr1ln8JmFneM0Kou9w6Lqybr2fcvSpnV3BKyFh30E0zxFvUcOU5zfIx6zpu8nIRe0q0 k1nxzUVQVuUHcdORHOiZvX5qvR01jK6hclJ8WMr9EY4vYStnRI0MguAW2oIB47Adjbtk wXlwSJ2g+VvY6pAj+qqhAHAXnq5KmD7CbNlQFOaQKYUsDMbiJJMVKbSzNaeJ6HaJU3oQ 2vOYP72reE52KdmtVMUNCtHAtXpPj+z43jBDtBBQw1+ynzf820nzv9uTRt9946C6Sy25 3EEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789491845; x=1790096645; 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=6Q+R860tRKkGNSd01+QxlRg3ifR5jM01Z5ifrXiDEe8=; b=QOjKbimr+Dgqp9r7NEQCLTDma7at1jyczZAa7NgkpWL38r6wg5HEXGw3nI8kgpkBkd EBQbxR6PiHYj3ivmlUADOUG5/KFNUTsLiBAMkgCieImAuiClr5Xil4bjQlx+NjZD00Kb qY45SkNPVx9JIxUf37Mj11shZXNu52TZ5jzB+J2ASWhbCmXhiPoJxO99LTWL77Fc97UV vvFiE2tP7GdHWmfyzC6diS+pTPdzTDqhQSdxrkXjfas/WLTsP18jlH96Ka9v7yqSQKUy C2iYsr+IrURtyUsJ1rvw2UxcLWzqRiaj4y6fShc1FNHZ/LBBwbkE4HYWLJyjuGLv+oh9 /GXg== X-Forwarded-Encrypted: i=1; AKwUvByiutiGGzh/wKq1PUKUU7Yxjt0SeK+8DwtwloBcjWbv+DZnWV6gSy7o76ppuGM8GwcKkfC6INlX8H4JEKQ=@vger.kernel.org X-Gm-Message-State: AFuF++kcVCpuNtmGvLeJA1ZLc+YvAz3g4zN45x4Mpp1roYxxd7ROc6uE JJz7O5JulLTasKGCbxz3hOok8oIVhrS24oIp/FXdryUeqEk26SJrKlONiZFYIMsbF0VTE8FpBJL +iBYBZLaP4FzaVRmZPNNTXZmu+G/n9QfpR+IvsOee6QN5nESuq50K25r/zFvKkJzIBZ4= X-Gm-Gg: AYBFou0jsO+aZF969YvmzaQsWpAWrg6iFdBmkIUQ2FOS9o3WxN10eXj3FWtkmIjKROy /GvfH0IpHEi2FFi5WiThl0miw7ZOYjeYROCKCjY7sATK7jouBdMkEHVCDCiVRCqrRN0cu/s/2Tq 1uImTyUpKz3s1gtTBLSCPw1GDo3kk/8NexBY4ThZelngzcuMOZP265xvJ50gXqR9CRKcp8JV6X7 JQAoYmbEe4Kj4xkKq/Yrb8nzDEb4YYOr6sFVyXZC2nOrIZisVXJcci4FvsDClx+AqS87C5Z+KFc u8etlwJFpBGK0X9xBdk/CjH3m5r8m74188VhhdHCAGOBCVy3E46FHCQMrSO/hhcgHkMCaNK2ilt sm25I2dEKgZAPlCXQMQBl4rw= X-Received: by 2002:a05:620a:a190:20b0:93a:c10c:6b5a with SMTP id af79cd13be357-93ac10c6bc1mr186015885a.29.1789491844853; Tue, 15 Sep 2026 10:04:04 -0700 (PDT) X-Received: by 2002:a05:620a:a190:20b0:93a:c10c:6b5a with SMTP id af79cd13be357-93ac10c6bc1mr186005785a.29.1789491844336; Tue, 15 Sep 2026 10:04:04 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf27df9sm391286f8f.19.2026.09.15.10.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 10:04:03 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:47 +0200 Subject: [PATCH v4 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: <20260915-b4-dts-style-checker-continued-lines-v4-3-5b8e09b11ef2@oss.qualcomm.com> References: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@oss.qualcomm.com> In-Reply-To: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@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=IH1W9IlOK+nkzbQ00GnaQXjHG0Qc0Siw6521Fcp0sS4=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqqXp3uPtpiOEMYkPf056eEynOVIU1cWbac986d PsYYVwqUUuJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaql6dwAKCRDBN2bmhouD 16n5D/wIfBxhvYM/8kM0jTUXsZFRkvJOL241xfILXz77J/SRKbtckBOl00urgBrma4dq/JxnD0C PmCpKRquVrC7IT6j3d80sUOtCUCGgPwzIi9SKBt0pCYI9TJDnrLv+0230QkyeD4VplpU2BBXFqe GjRbKdQxqgYqh7uLB//n3bjQa4zLb9OV8nWqIvdDfRkxuZKiaUNv43v1ieEkWgWmZa0NhMTSewO r9tsY9CPcJO6aBiJBxwX1RANLNTlKIuQHw/sCuQM6KHF7/DRDC2mrwp+WYZsaayQPKUkV1IfiRe 74XUk/bqFLTRH3hNhgFxt+aBMwi5aopHrcUiN4HQErrQB8yvD4ciTLqoT8IdqbM8iBEcuG18wWH G4mE80iE27Wi8T7jb5vCDHwpUsYXUTaf9Nkz+I/mGFHNT1TWEUrWkrRLIZ8WV0cos01mH7do5IE VwT3P+IvvUvnHtPygiVj9r4fdgY0Pd8ZjmMcEzecORRWgIa6z3LlzcTUv/oEmiaAXu8ghP1Po+J VNwkjPjCeTyCrFUcO3uIKsvuhP03/PXpaTK88L/JQ0GgrGsjOeexvp7BZjROtS9PwV+fpsl5nwn 4rkSkrRDa4gQOODkd01dPFUs2dmWPIUX0JaBF+IrS5+/7+2LCv+WuIYzAGdC6i+Iuh9RQ3XbiS4 GXU+Dn0tvySB62A== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: CcmgdmG3YzyCmRglzngnospXxEK30gOU X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfXxFl2pjvTulgU ZDRo5wzeSwFIN0mg2Mgp0aiyYAIgcIJi4LlPcyAiBNOWR7HmRxFO7qW+A/nMMVymgj0crFoldf2 wjJ/L47d2BFuGiwqc78MtSRRbkXosJThE3ZrH+vDk7R23SM6XnYX5Grtr1eAh6+t8N1F6iNXP0R N6UrcBYBgPoESY70KmCrS01JtQS727Rrv/Cc4xcmoPlEZftOX+qAnr6vCzyOQ/7PuiPgPoySxNM 93A2pOKhLiKFu5KGG/W/8YKc0tNMfug9uWcAv2fjnzkOyFPO93yb2aWrTRlcRMLnrPR58NT4TeI 2qAkU873E6U+s3clsDrtHMIfCFY6xR9AkkOVhIj3X1foj4VAyiqVDm53m70uX8ihpVpHRUiJhtU DQpQiGgNnRuktKSiKbuZUFjcqx7z6s7wAS4Qg2z9WXOCFA/kdcKAoZ+X5Pt35TZ0CZRV0mXpYEj ZU5aSo5ty70MJ1yBdYQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX5MttphrFG81r FTZ/WEdZAnSsSYZvsNgIgdXTSOPzmfNczVFf6t4yR5hCQjxRhVbD9xScYj2bNxaD4JJw7ZaLOPm 6mN/29o2m/P3ALOFx/DOIADv0X2I+ps= X-Proofpoint-GUID: CcmgdmG3YzyCmRglzngnospXxEK30gOU X-Authority-Analysis: v=2.4 cv=IcISymqa c=1 sm=1 tr=0 ts=6aa97a8a cx=c_pps a=wEM5vcRIz55oU/E2lInRtA==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=n0VsRDhmN3h0bdBGaSQA:9 a=QEXdDO2ut3YA:10 a=OIgjcC2v60KrkQgK7BGD: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-15_04,2026-09-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 bulkscore=0 clxscore=1015 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609150249 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 525d9df6c11b..4ac10cb45068 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -976,10 +976,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 07:23:39 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 9977F4322FC for ; Tue, 15 Sep 2026 17:04:09 +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=1789491855; cv=none; b=qQebimfo6OQ+aY70Il2qnJFT7/WLHWrTpcuY0aXOdQ4eEu5uc187s6V2g2P/yu7wE++R/xnThFkylDchAAEAvvGcneZqWhtXCaAXOD8eBKK7wg/1+oU6bJBssLz7nEf1dC+xf8IdgjWyzXz2ZNUf5jug++2sueUdSPb/GZb0c4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789491855; c=relaxed/simple; bh=L81LsD5dt2z80+u6Ly3kb4t/zssWAB/dbbZXYGdYdyo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CUZIQUMTKRe00/pZqGW0bh6EWlHYnVO5UvFwNSvPMXD2GDY1980YWkPqLtgeeRNgVXH8a8Zb8+5yMUuwQReyAToJ+NOiJDMiZwaDIXjBfZThOMrV7WJdVOfSPTHMp2huks8g1Ousa1RWp1N0Zn12ETKQBXyYahXNY3ypRmGJBZ4= 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=LKHR6AX7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gfHRLeyA; 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="LKHR6AX7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gfHRLeyA" 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 68FFAfgJ3567052 for ; Tue, 15 Sep 2026 17:04:07 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= u9V2uf06CZxfh0B2jLj6O+uO2SpqOy2t9fVypmnR/F8=; b=LKHR6AX7vDNXRalr H+0r3BPDrxiWXhg+u2ve6mL/sLI7BezJElIw7Bpnq9MJnGxRLFP9QFw5L+jlI8zc 1ORetvWncn8L83YxDe//RnYKgtfPB2VCXyMNTET3UId/V6JFbaJ98wKx5RIGQick W2okeT5l/15lZ3f4qB7e9RGlP/ntLWcup/1RZDqXHBSXI/Omh0dra4bH3Xiezt5N qL42WFkp8tWG2M/jGHuhA0MV/Gc7BJZo2ycV+qArfYqdldyD/5ND1xSR50xgv8Gd ZbUFjcJlgpX1L45rxQvZdwAmIPubAE1bc6KZeGMuaMsjq3z3UEpK3Vr68yCRu7uv XY9BEg== Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpxydb5vu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 15 Sep 2026 17:04:07 +0000 (GMT) Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-5c82f879767so5668907e0c.3 for ; Tue, 15 Sep 2026 10:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789491846; x=1790096646; 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=u9V2uf06CZxfh0B2jLj6O+uO2SpqOy2t9fVypmnR/F8=; b=gfHRLeyAJ3OPlv0Yjrf20SLwctj3GyvoX+2sSFPoDAV3zaPw23woof4/84vKA2sue/ o1zuW57hOX8NlYovltHhnx3/VbhQl42Uz3phA7ISo8Io5b/CrhJ5kmoqfO5c81AU9XuW iWVfZMC9GXLffUNyvKOWDfd7xHSM9QT2nbVQOeigz9M9xqY/qrahBqqaHTAsY+4JiPYF FCpwkB/Y4c4xe+beBtdKPtrjZq30lQrqXKkveB5ecDnn8u4Yp0ab/aoJjzon6QBLWoKV jXQhStSa295DFEc9yYWUPGEuVYvIr1wCOwzGzsCy4dN9rmU6fhBkI1mMnvOHoed7aLOR 0POA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789491846; x=1790096646; 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=u9V2uf06CZxfh0B2jLj6O+uO2SpqOy2t9fVypmnR/F8=; b=q7SKe0kCoxDPlhEmyDCxAIfSC6ZkXt9wuyNuv1Og0tQQm41No4Hc4ZPtyL/0hkPA6j 9ctsLUEfgjoZcsxM05CLZTCl7ibEoMlUL97GfDERqE7IZmNbF2tr/dDOE9rI2ubxeUaE hjXkztWTeYqsB4nfi9fG1Gji/ZAR3ScNk7fhsm1ceqLgaFnwHf5+EL9N52qFzHDZerNy ZSXc4wYIxV81I95+7nftgEUeT6LoECTAw00LxhEqv3K6k2GotUBj7oIRcJW3GHcGNij9 f7YxFV/HjDvg1/iUuBlgLcwT3SCP5mNWAvm0PwUhiErN3v4pxO4DGM1ntPjsnx6azFDR XJow== X-Forwarded-Encrypted: i=1; AKwUvBxRxZpS1GqFq8KgINdGzgXBAC+vTG6/llsBmCc6Vvc3AuyfIhjxYIk3KcqLuyp00Il/hVA1ibz+f95inOI=@vger.kernel.org X-Gm-Message-State: AFuF++m2dXkdS9+Ave8H1OdMrzg8pqqUj/O2DG2oyP+pcu/lpnBu2Svw GUqM2nI4ZFqQwhwdmaXPL87NwuYQUxLTLXJ8jF6RS//aXBUzrUCgYiMdSbQwdmk8xdl5Fl1M4a3 dXFQsG7tIp6NdreEFsUQ8OVogVeMv7rg6XdM9QkxeJ9xvfibDR1V2keJwD3+krL82Zic= X-Gm-Gg: AYBFou2x79jS9KOBIfD2MXKyxgNUTXse67Y6lisLeF+uVKaWKXGlqReuEh27o7E4+LT /ivXchUYUCY1obIzdGcTOFMvWaEGvdAxTxcOSO3YCJK2kifMD8c92FCe3VutkhQULAStEmQdkQw d4WnGuCAR5w/nthfNV095id5D4lxcTYsiPcOhS4W+Lz2ngoziMoWpNv4VA7obYTSpN8yGD+p0H/ wCEFYv6bhayL/rOvOigv98mdAhKHw9VBWhg2Dgz30W26oqKw7FdZ70i0MFgJdkTM2SOoX/IcUBg Gv5ELrTLB0GiOA6YVitpY6TrrmLWrhZ5lkiRCm1ZXrZaFIMp1WOAM5aWdOmw3xLMGNwnAKZVc7b uUSNXzsfRreAW5+wlT2DsVjY= X-Received: by 2002:a05:6122:3402:b0:5c8:228:5ea6 with SMTP id 71dfb90a1353d-5c993acb5b3mr4342545e0c.5.1789491846611; Tue, 15 Sep 2026 10:04:06 -0700 (PDT) X-Received: by 2002:a05:6122:3402:b0:5c8:228:5ea6 with SMTP id 71dfb90a1353d-5c993acb5b3mr4342454e0c.5.1789491846150; Tue, 15 Sep 2026 10:04:06 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf27df9sm391286f8f.19.2026.09.15.10.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 10:04:05 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:48 +0200 Subject: [PATCH v4 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: <20260915-b4-dts-style-checker-continued-lines-v4-4-5b8e09b11ef2@oss.qualcomm.com> References: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@oss.qualcomm.com> In-Reply-To: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@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=L81LsD5dt2z80+u6Ly3kb4t/zssWAB/dbbZXYGdYdyo=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqqXp4dkw3KmWdfT6eFBPimWYNRIpSfYEuJiVbq rYG4PNmPoSJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaql6eAAKCRDBN2bmhouD 10mFD/0c9I84Jc46H3Cba+JBLqKLI/IEubsbF3GWKEluQuLWxS7OBNcSZeE45kEbidJoeguFTzP x3Mz1E/d/ZP82+ePl0BfxV1iJPKhzKPfCCVP3srNvkENNFn6lo3lQ5Nw9pHOfZauq/PU5XAHG5V hnCEl4+uz+aNQwN4PVOzFFhRWPmqiskFGDHZYNiBgZs15mIG6jbSnFozaj65vWNSCK5Hqd/4tgi blXIIGdavIRtuHA3x3QYa2dNvW9ecA9V2F2gQj/3RSRdO+wnAz3DrW9khkwXqT4ku/II1h5oO8b tiQB7PhAtTPN9ypz2AoYdUZru0nX9ZfUE6MihvtdvYWSYIOKXaiN47tJVizE5B/xYYf49f16lWG NbAoeXlPua/K8lAFUfznCK0DA7uAZSo6m9UE3VJe7h9SOur6WtjLJyqYBwcm0vtPpLfwuXyok6D 57s+DE8YVegB1bj2kdfHHJeVQLSrJkpLCAGuxuP6P7U9RVBFJKjny/sjgGHGKvFUu1SwD20GqDB Szn+XFAXk4orVl27TlLAM8n5UYUadQSEWOQmw7W4q1eeGCTUzZN2WxpVLYkstiSSpGDS8U3GU6N G2NEnWKRlvR4fdYwStlycBE/9PWO6gginkT33WrMvtVyDA2xXrOsTNEGsmOdzP9GPcAKae1SjHA 6/z6apihTiDvCgg== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX3e0wdQbcquNG OhqEBrM7d7cFNaAjLyOPFIPorBv4ngGuyQcEDrYdpkOlG2ekMwhJVL9KrDdwqAjodHD2mjWPwo+ GtQyTeQVYV2ujPZaqRrY6kAOv6FpVOY= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX5LxtHeIZfSEB YgtJVwfZTCRRdjKdxqjYZcHHEiGs0BKmJ+4mPzLAeGO2G6PVIubHGYfooheIFinbUyB4r97LCRo KMiQDfRk4v9zoBO5al641VCG+6nMNGhu+iiQOO1ErFkXjZ+P7AdAo5mYig3z/hnV4Xk1xDjCfRZ jOtVUJ5hdPWROYvGRs/eALWXaGyR/EuHPidc9X3H2FFLMwrp5i0H7n279vzhc7tPTLhWcVuKRSU Sjz549VjwW5D+6PW0gk9F9GdZyiuH7+hXuxVBexMNLEoU23A307JbldxhDlqoKsA5Yc2iEJvRzH UnD4EjjwbSIU8wZ1Gzk4t0OMVy249WZwsswDs0sPsogjSUxLOZCqaykUSd/v2ZILF3jAb95/tKG ylQjPRxbkrrxb0AUQ9kW5gJTpHRa0j3YoA/+hhxaxI8po2klFPGIY+q+aX84Jeu7GbKvFHxGemo cHWqFZ8riPnF11vPQzQ== X-Proofpoint-ORIG-GUID: B_oqUvQy0ABnL3qCcb3M5AzFLVRqKDUn X-Authority-Analysis: v=2.4 cv=LYepeTfi c=1 sm=1 tr=0 ts=6aa97a87 cx=c_pps a=+D9SDfe9YZWTjADjLiQY5g==: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=vmgOmaN-Xu0dpDh8OwbV:22 X-Proofpoint-GUID: B_oqUvQy0ABnL3qCcb3M5AzFLVRqKDUn 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-15_04,2026-09-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 adultscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609150249 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 4ac10cb45068..41c97d996882 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 07:23:39 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 51BAE438013 for ; Tue, 15 Sep 2026 17:04:13 +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=1789491856; cv=none; b=MY7sYNGFnLNi50xaxxxsN/kuiNTZ/JiX0ncJaA/33ErYH379Gsqws6+5tW89ajGYZQs5s8Kklu2+YzUmVFXvokM6chKt3SO0GPStbMQgiY7V5J/cDcmrZne5e7U/B81IC53B+IYf+YMIBceqbKwzr4dZnNw4tSieBCKt9/At060= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789491856; c=relaxed/simple; bh=hjntdJUmLLlpSp65R90lod9o1WQrohD/jePzZpT9g+4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eMfUTlSXhgv4OL+X+AtyF0lZHNA++9GDltiZe0TrK8Id+vOO7maLKXSaQJ3o9DOLo+9aRw39mPDwCiDSstKZkkdeA+hSyNoUgJSMZmDnyaVl6VBNVmwazCDwImj1ZP3AC+JT51h9ng5XMnERER2PPyPeaXo/aJzTCyJ8XcDvD9M= 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=TUFcwhQL; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Zb9sadOq; 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="TUFcwhQL"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Zb9sadOq" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68FFAYsZ3958808 for ; Tue, 15 Sep 2026 17:04:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= RGhQRLp2DcKp1qv6Y3qdZKbSsx4vf6J2PmKbcj7Lreg=; b=TUFcwhQLxOZ1ZSVh 2pWOjkjT7kzWdOOm/8ZIJ8b8Ndyuz4jq3LAchyY1LlyR5u208oLUH/RTANjykZOA cZwHJ2iYvZaTWtCBDn7vQoEvYv1dUH49WFUXtS6AMVevuUhuU08ux3yEdTMgIS9o XrPXJd68ApkjfodvJzVGDz3YQUW8s7tH9tQz8t74Ii9TGnGf+LsJkQvNQgNL5VSg QaIPZZaQBLFKlTSDX6Oxv2eK8I33NoAczNXOia+RPVliqhPzhxOJ7g2Sr6oHQ6PJ VdXLv0PeFvz5VJeEKD5ao2auUvJQ5Rakgzb/jhP+eVGbk3Hdt3vVwn/wzvSRSL77 ZtsjCw== Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gq2y2j822-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 15 Sep 2026 17:04:08 +0000 (GMT) Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-5c58ce17b04so5557249e0c.0 for ; Tue, 15 Sep 2026 10:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789491848; x=1790096648; 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=RGhQRLp2DcKp1qv6Y3qdZKbSsx4vf6J2PmKbcj7Lreg=; b=Zb9sadOqbHzp4LtilkImzjN/X4l+H1DAPhRBs1lgHb7xI9IYN07zXYAsBzN+QfRsC2 xqvXuISFJHphQ/dmDmzoUTag00D0H3TPUUwUq9RYsfKgRHwKZ1ybxVzaAlbu/O97d1IO v33nB2rfLoYQ6BUyyDUdiDvvym4cq2OIUr3WRsdVYfRL+uKH9Gi6pBlIIHzYrsVm8kmi 3C2ZxYbOxkfVSOXkxKfmrf0GId7tJPwhDKXYfBTRq/a70KQ0bdOsWo10w6xyzl1g+oWs EIGXloGsnAW04EkOU7rv6lf2Hm9+Rk0XqQz7ddFVyNO/9i1lzPUSAbohxBnRQ/FblU2K Tlig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789491848; x=1790096648; 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=RGhQRLp2DcKp1qv6Y3qdZKbSsx4vf6J2PmKbcj7Lreg=; b=D9wvjkVFEdaTwRQa94DypxlPuQgG9ARZJnt9C1x3c9Htu9i9YeubKiHRqPkGUS0bkV fY2NbZTdMU8SxRsUTtGZGRiDjfoJDRyhGuY1bFasQbahc5bx70uL+8RpNT6UWRl8J3VR 4kFHG27uaSFNgQjofHrrp+8onPTbRaYIjEf8T12poY4DQpFHUnRjAlK+O2hd2Zg9fqRA DF/YAl7i1ZYOhQK2JfUheUimmwRUU7xEknUYr/x+uJT7kxZ+rd5hEa6aImLR1TjBsQLj 1fyyes17VIzn4k5/yWfgzMpd0hkZtd7Iy5WRREYqbXYuGa6XlMycO3+tdmbaWoUrao/7 cCJw== X-Forwarded-Encrypted: i=1; AKwUvBxHXlx2LnhGDy58V5JjOakYLsxC8dljvVtFBPdNlzU6PZ8KW7zrpXFLgCfX+M7Q1zenXK0eZ6kb0wMgfJk=@vger.kernel.org X-Gm-Message-State: AFuF++kqoPVQhCWd6MDqzju80gqC9mhhferC5Ab1z3LVDQ/0swWudLNl b5GUxwyMnT4Lw1LVBp+n8MW3XADsbqn4AqOEbp4EbwAE+RI521SwE3X8tkd0YdRMmLTY1CWE2zo 9cxuO81XhPzm20kJ9FDgYZ+dE4jvQWFOWLohK/9Z2L0i2JtEFveQUvj7SrYWC2hkraP8= X-Gm-Gg: AYBFou1tRa6axhdU2qo8GEmBsg2FTRzkEiHtbBPCVPf6w/faXay5jwUZUhuTMwRK72R mazqHrjn7vAJXguT4RNX4st3/y2ABs3iHEbHimfNO+xL6U7WuARrzdUJSvyJgHRQaRO2vDzMdEv cjzpqMYQp1Ag3uUYK6I8G+rYYudKlkRPIRgxs9Ya6ZteJE3Wg6kUh1erYNZ91UoAvFchLR9O9u5 yqMvKBb6rimeQ7YoJC6ZblmRcMV9ut9S8vr9mGsd6/2QbKRmrOr5CnWoWbeB2ExYnKy3QIYSWaK Ut4RZRd5poH3COZmoJkN+bRrQ3W8Gag8Be8RPc6tuIpyDHtbSAFLUJVThNvqoxkQ1uJ17VOUYuG QxD58gplqc/vrKhTXmtauP5Y= X-Received: by 2002:a05:6122:208d:b0:5c5:ad20:1fc3 with SMTP id 71dfb90a1353d-5c993c40be0mr3650294e0c.5.1789491848153; Tue, 15 Sep 2026 10:04:08 -0700 (PDT) X-Received: by 2002:a05:6122:208d:b0:5c5:ad20:1fc3 with SMTP id 71dfb90a1353d-5c993c40be0mr3650191e0c.5.1789491847684; Tue, 15 Sep 2026 10:04:07 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf27df9sm391286f8f.19.2026.09.15.10.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 10:04:06 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:49 +0200 Subject: [PATCH v4 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: <20260915-b4-dts-style-checker-continued-lines-v4-5-5b8e09b11ef2@oss.qualcomm.com> References: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@oss.qualcomm.com> In-Reply-To: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@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=hjntdJUmLLlpSp65R90lod9o1WQrohD/jePzZpT9g+4=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqqXp56de0sb8Y3WwMeTi8g8H6V1h+EgMUW6N6B mIPS0hNv9mJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaql6eQAKCRDBN2bmhouD 1/QED/48YdEsIcg2HhYUkO1L4ZByufS25ABygaWF+Kk7kqUzC/8FaSbIoH9DVy89dOUdfHJhvSW vwLO435Ozip2xeljzjCeM1qtoMYqaGUavmaSkBtAFvlIea33xM9sG94mb84bbLMimUUOBufGLY5 XiGBMS/JcSWzWJBIzjOsK6TZXrJfpqKhKh5S8o2qdkvNsz2sVxpVk7x7AapbRxlvq5HD8wlMCxK sobCzFqOWkcQp+fE8NR1v6zlKBlbz/A4phX4ClrcL4sRzuFpZRagQjRlmSZwTTyB1tRnucssIbR fghsYKRapXskJUvmRkmgOri6IeaITl0gKdQWeGHG2iIuBSfBmckp43bNwh4X9SBwKEAs+9GERiG wUAVc+jNoz6gt0iG4bzQ8bkoXbzi/sIwymWmCxBv5f26mZvtWebhX7FVvjEFk4AQhhUi3AQsIz1 SzbXc8iaCMVeEQQG1iwo8nzVK2ZPiIwDxSo58dTTC/njSDO2XO1vXxZCOLnbZZshtclIelUMhxY V116Fd6Ww3s0acni5YXdGKyf3OqUppAqy1BN1tbsR/3Y0XNXKrXhZWCoJC3un9l1FLkknobBFN9 m5KGI31J8iEzDy7Jp1sDw+NVLC1tc9FAMRB/3RHCcAEr63jt4m3i9Mv6TocDUV0t6ZtoxjYFzao TS8X+oblhunpqtw== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: u6LWFIitSHDqJiY1TnqvO6Dm1brcRAxE X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfXyCxnbIxN8L2D yH2ipY6iuBEIXWlrTBdSx38TmpNVmEP/kNSV0XvBUeJUSLqPFlkIVmWSczC+E8PdIY7gGdcwCwG 5cXusqfAkx680F9BsB1TP2Lvy4ApzVsalGrfo3SOkSntJth/R0ODbC6N2b7SSoO4d7bYrXFnwh9 s/v7BXnwRDri8xYlVW0lFqkj0a+wVtad6EwICm0Fp+P/In50PnwpFwTVKAqPAyQqunZYGx0IMUT 72jhZSrH880pab3arQV+cvFBWnKvDfJmP3ojXC5QCCwVbTI3fwqrSKolCNe3/DHiXmOqmrq/GOl ZTESfMCSjd3/DjtYtHP7OoMPnlQSKqx8YIwC6AFtc/39ZW0bqWVE6dtBqveYmDG/p+GDSGP/zR6 Qp1rMdkjCuNmGOiLnWlxCmizt329rwJIm8A6JeSOPelIMCenFDdKbPynE3dCUG36XSnW1LdKhmZ 5tZMikL5bPnwfUJsdig== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX6FsLh0q0BRv4 Hxk6QcG5pTZr6RzEraqhwHaOr359T9k/rdeJ+Cxjx0nn2OWIWh1SqlhEdKUelxHph0OEh8VcxMn jZqHbMb90t7WV8J+ViJzLJEy9YR7124= X-Proofpoint-GUID: u6LWFIitSHDqJiY1TnqvO6Dm1brcRAxE X-Authority-Analysis: v=2.4 cv=IcISymqa c=1 sm=1 tr=0 ts=6aa97a88 cx=c_pps a=wuOIiItHwq1biOnFUQQHKA==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=3nWb1Bopbj9nUPZVt68A:9 a=QEXdDO2ut3YA:10 a=XD7yVLdPMpWraOa8Un9W: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-15_04,2026-09-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 bulkscore=0 clxscore=1015 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609150249 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 41c97d996882..a36c45c29476 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 07:23:39 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 A5DEF42A14D for ; Tue, 15 Sep 2026 17:04:18 +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=1789491865; cv=none; b=qhSajbsRmCv7d5tUbTtCbHtQedcjWDFkjUE8RS1VpjX7/RiHeLzEKx4uc8RVqzzB318m/6EAggwh+QAXSvI58zZ8ApSrxxJ4F8WglQKfJJWLkdFLzaSTsNdvG6n84TnNmxbUSt/kZgZi7kd9XjCosKN/JJBbR6B91Xk17x8vofo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789491865; c=relaxed/simple; bh=741ERsL0tFk0OViomsB6cXeJKp3J33B9FRo8i0gUf/Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sgLqPIfTymbtpXZPHea3hEqOe56ERAOJCywHB9g01m5KApEHXe5EEXzbrtSuu3tDuwZiFIZfbuULN2LZCp2+b2qgz1etk2MPVe9s9NSHvEvXUGHu7EteR2j9tYYWWzvdS+YXsEZlG9gMYIn8yMZhrH3+gA2YkAlTQe9syHeppeo= 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=F72TNFxi; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FDkAJKKt; 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="F72TNFxi"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FDkAJKKt" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68FFAc4M460771 for ; Tue, 15 Sep 2026 17:04:12 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= a64CUPH5JJ0RgB3MbwcpzE0cQIAFKA9Mj5OWDwBTcZw=; b=F72TNFxiUCAhI2fk UIGHht88ct1y0zzL/4xEgYz2WWIqomHSNOPaRBWdqYrZqvGRzaX9O4xtUndjKNuz +C7asnt4B2kKSlSvqkTt2IxZUixf665MLLnBraEeZfUGsgiEG+a/VvPxftcequGp dd2dD/Jj7CeMtaJq85Lf4B8JJVdom43v9gzKTxrUgLyAwAMe74dt3viw1n7COxz2 teuMvFBl8qos8IXHyRyLmw81dh/OYNnNIlXC1Jaj0YYSt2ObDpSWV9xA3AOFEVK9 0IxEzzyI5FMrO3o3Z50ceZK2SRczDTzM/l6a8xuVKeWdzxqtEFnlNibEkr+4Xn7W U+SdEw== Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gq0jetvyr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 15 Sep 2026 17:04:11 +0000 (GMT) Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-5c96449cc2aso1369602e0c.0 for ; Tue, 15 Sep 2026 10:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789491850; x=1790096650; 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=a64CUPH5JJ0RgB3MbwcpzE0cQIAFKA9Mj5OWDwBTcZw=; b=FDkAJKKtvl/Gfdx31FLa29+QIC9SkcDHkkoUSuVJAtqa/Q+jUNjiE8D0fxKOM/A2Ge F6BKN9klIYPeYtbrMx/DBgeWHqJybMuXjIoYbXSNwblsRoR9+XG0FcVaXEOEzvo2/KCP PBMyYLg440z8F9ANBwvx/1BMTA1jhRdjpDR0Kq3nO/gGQfJFtoVhPuVXkWHIY+3xQe7g BG/b5UjArfSrcVgILG1mdwo7W6wc29kKWCvgndX5On+fJkFyg4zeSpV1seZIJc1Hwcf3 9zMRYi54c+zhHlpjd8EcNJVXYwYGptWXTL7CFfo7OSOyVNgLZaW3Gm/BEMSq23OxnA5e 3eLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789491850; x=1790096650; 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=a64CUPH5JJ0RgB3MbwcpzE0cQIAFKA9Mj5OWDwBTcZw=; b=Yqvzjy8YgtUE/Y7Jgu3+Ca/2nLtfDa5kb1jqdG3UN72ANjZBljvWUvQCeeO67RyyMK iO9q1EOJLWroJV4+gSmwlZUrcDUQpTwghzYc3x1NmH+FPlv3MilQA/Maiy4e9hzWm96u DaTpuhj86MjnYQRTFouEiQXQ4nzjnDyYv1kIp7IOtjmD7u8vBnV1T1IZKJqQZEy6/eaG Lqvy/ylL9UazICksrsj5OiKTwoOu2w7ImPahXdDku9iKk/dxyMzCY7AyP786wh9MoxpL 2Y0cF8Bc5CZ3TZ031cyuy+ELLVPak4a+88H305+/Ca5HeIEB8nD33ZS4KntLtvv2ZDWd xaJQ== X-Forwarded-Encrypted: i=1; AKwUvBwYkQdPgbhxbkWD6xThFiUDCt/EimEo2TUtX0W8j7vHwhHoeVmO5CkVKSI8t3edhLF3qzc58PSmMCKDEJE=@vger.kernel.org X-Gm-Message-State: AFuF++njmXVYj5agoQFjp2wPTsu6D3TkwBtt15z1/eiWYr59/7LQVn55 I+pY/RhgI8Q/JAIgLQoql4MjJr0A0I0TL6CDW/nw+mTLo6oKcloRAiKBveG6ZemSbNI+jPONtdf YIFi2MwHeEf+S014Vi9TSdtJjXxj0SILRXgcnA7z5czjUf/05AHuYTY8F/tCPnF7i3TvOzH+5XS k= X-Gm-Gg: AYBFou2nJlLGYhCx1plDaZ4cX4E0A5dp04/fHtM2iNPEuGtRISLEAWoZ6rvRMQid7Vp /dR5uWofkS8swqiGtfjSCZbVV/zgYbm19xDjoDxfxqSTdgUl7Ro2iX5dl7T8/Da7ntzJKWyXA0e m+mK6AfrPrCM72Mjun+/rASEBqmxcqM3cSWonBiljV9dS74a/kRj/xlqd/CYua2HUTwOpXxdX84 EnEaz3Ao0v273k0PL8asePggEnnhI4kpv45dkd7geUuJWCh869zd/5MXiJd+aD/1j4mZ99tGCHr v5idoK2O+JnEQNuKuHofFxhJYO/zMnLT0gN8WJ920pcf4Z9gXT/JIQmsUDiLrAhh36+/f3/ZQHh zJb9Y6BmCbBIfxpUoTgMYEME= X-Received: by 2002:a05:6122:d17:b0:5c7:c898:9817 with SMTP id 71dfb90a1353d-5c98a4ff3b4mr3133288e0c.7.1789491850269; Tue, 15 Sep 2026 10:04:10 -0700 (PDT) X-Received: by 2002:a05:6122:d17:b0:5c7:c898:9817 with SMTP id 71dfb90a1353d-5c98a4ff3b4mr3133075e0c.7.1789491849495; Tue, 15 Sep 2026 10:04:09 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf27df9sm391286f8f.19.2026.09.15.10.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 10:04:08 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:50 +0200 Subject: [PATCH v4 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: <20260915-b4-dts-style-checker-continued-lines-v4-6-5b8e09b11ef2@oss.qualcomm.com> References: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@oss.qualcomm.com> In-Reply-To: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@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=8586; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=741ERsL0tFk0OViomsB6cXeJKp3J33B9FRo8i0gUf/Y=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqqXp6Z10oOYuzUR/KSjMvmLKXL6UwPnrgZpcj4 rZ+TO+sHoKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaql6egAKCRDBN2bmhouD 11QID/0fA3EIkkIejX03IdxoEs8ukFgYIps20UGxVYbZAAlAUiAzS8TIP24ptYZ4caJXqvkMLHz IUsjOBSfpTEel60ddpjuTn7Q7t7T2jXreJ8ZWEZlRn6KDmmlU0KZSW6EOXUa3PoPt3V0bExUzIo V9I6jxnZhJddizI8ku4GbmeDNWU4o1gS8REELetNcWQvj4QjNPA8j1WjeyXM2yus0JCIKRBUyH3 gq/HgRUw4ut3/AJaELhXKZqxmnikekVugp/hls3cVicZAYGXngxH4zvo8tMlLGWJUOdaUINY9Hu rwATWNzZfX27SQoYhHHEyM6/B8kgEMlTSO/oo1rN2gfsKldPQshkSMTUxwqLwzLjg3a6IsrlHpv 6KCM8u5c9tNYHa2yq7gXWdu20Dqp3dDmb3KbOyRVoRukoR8ew0W4bbw/JfZQp4tLAs6NLYhEiiG 8bA4RvNbRi5lJ4gcpP4PE6MphAcPBBtjxiTGUZN7l4cgzd390+kHDav9ZCnyq3F3MLSQXtibQe4 mgqI07x6oanEnWv976EJLPdTU7RRzxKFswXYPa4gDMXqFK/IfBs9Gz0yzvt68+LfACuR/S5zjRn V9ttZCA0lTtoJ3R7yKbDjLjf20BSHwf2v26OtnbJJiqcnJOiM+yn37kPo6SYSyMOBHzeterYzEc GgWJO+GKsIqCn4Q== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX/Yv5P846lgFs PicXHJ/Xqm7SVX38iuI6AOXCi2e1SvEDSEhXz6hdwujqK++ZB62BKq7Okf+iUzWwwKylWRFIYGZ nmUIXE5litgf3iJ0mnRtzPiqJX9CsvQ= X-Authority-Analysis: v=2.4 cv=Kr/YSmWN c=1 sm=1 tr=0 ts=6aa97a8b cx=c_pps a=+D9SDfe9YZWTjADjLiQY5g==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=Y8AG2edEbfE3NdgbFfYA:9 a=QEXdDO2ut3YA:10 a=vmgOmaN-Xu0dpDh8OwbV:22 X-Proofpoint-GUID: ft609fxwm0GRup-R0fkG0mrjP_TULIDe X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX6b43DTcgB7Kt ZZVgfdfPpj2CAO16ZYznidrTtHSKdtFHHz92RuQsWj5GDKlUimxAJLSzo2gM2G1hnso+A3y9RaA 2Xm3yHgctiYDpstAUO3nmtfIKRCeBswRCi34IGOgl8r69IurRhW0V0k1qrsx5ffc1Fw6Yx6ig1h LwWE1RQCKrZX3AScPFf4isF8v2jv050G3cDo3At3GBPZqVrxZnUllGl3ocYlkOa2mOvx5nGDGmM Gl1/lJNWq1QQGtJzSBE7ioYjjI7oW8020QTM7DobLdn7zgLx0TzdPsLdyclbHf9rc+GMYHv0wP+ ouLcqgvgPwsW3qMxAmBMK6bZ+dV4EDCofNjSoUxv2EuOdduJTk9YnUKyFOVyckycm7mVP55PI/p 1aJr591AYFeiywDeQvUiEABVV5lp7gFyeEMNfG6KzTJ3a0XmH+BwL/7NhVacre8kGW0FhCIL1Vt eLyFD824MsSuW4JXmvg== X-Proofpoint-ORIG-GUID: ft609fxwm0GRup-R0fkG0mrjP_TULIDe 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-15_04,2026-09-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609150249 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 a36c45c29476..cbbb8d384aca 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 07:23:39 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 A93C94302E6 for ; Tue, 15 Sep 2026 17:04:17 +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=1789491864; cv=none; b=Y08T1sNVEX2dDaS86kKPPr/bmHMZODSHyTOTZdOGM/D/x0cQlHVOTbPvhFFBc3KXZl3ukS7oog09/JvQg5K2INxuhMtLHY2toan0E9nHx7wQOlIgRlSUjDp6P1VmirfNQq16jF5oeaW1glcYUQD8qNYsEMCNcjQak1mTTbvtStg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789491864; c=relaxed/simple; bh=laSAp1YXGXDB0JNefD12jAWtTX1atEc/Z6Li1ZTRn+I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=W8nRsZ9VaCIeb+wcWJ+Q+CRAh5i1C0J5nNrsjHrEPGHpH04VRbTEbiFZWZUp7vFt8WnnY3wvTG4ruRWGSfiNVO6yjjikmL61uZRffJzvYYV+Lj5kWTp05lhRjtvNruyQdYn9jtfFDn6GaDiqG8s/gUX88766luU4lR7XD8beUHs= 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=AVhyBYw4; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=C4ssbL/7; 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="AVhyBYw4"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="C4ssbL/7" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68FFAQXu1014185 for ; Tue, 15 Sep 2026 17:04:13 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= 3wLYPADb7IYlvunm2zhGRsvnaxF2Q1CLllsL+hIEt2M=; b=AVhyBYw4SQum1JL+ ByS31KMxr5TdjoCrk5fLWV6vCsjaK3wkQmDYaupE2G3UkcLxUnK+xAtECTR9K7/q k3RuiVlmjzAsmsyxhOoWzeXTYQKd/uXWVi9WeAbPnKqZi3kq1YVfbdhqYWO1z0df m5VTV0o9IOkg5/5GCCvx/C4FErwHtp1MnjKT+0exlL6AxTCGB5cxoY/EiWgUKkMq bHhYCoG80EavMU8jbDd3H25hzdsnvVHA/DKADsyqDdtMG0nqke58K6Gq2KGDhtaB +8KzqMoOqEtgDwrT33sFGoMWX0TsUuZVPAqoMkA/Hv0sVuq5okqjyg7F1D69UvdU 25v9BQ== Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpyea343d-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 15 Sep 2026 17:04:13 +0000 (GMT) Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-5c846dd12ccso1850742e0c.2 for ; Tue, 15 Sep 2026 10:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789491852; x=1790096652; 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=3wLYPADb7IYlvunm2zhGRsvnaxF2Q1CLllsL+hIEt2M=; b=C4ssbL/7fDGgJ+ohsjLoGPYg0Ho5fGTw/TBNRv4cUPZkMF19BCFgUSKUZWOurNeY4E my2KoKC5IRTjc8CKCGZRxt0hteAtp0qmFy1C0/oTYAoLzqSQmGMBSTnrvNl7jbOeZt06 RUFS7JZ/AdNkY7FXIyBXCCFoSijU/sP8CcGiSsyZ1ATAkV44rDUKRTOk96Et1AP9/w+k gtymVLrLImqXU6JQdNKzXcio5ahKgik7dXfUj1NKTNZyJJVs85OfI0MphxfCV9aB4ZEH ZU+UABHandGxYFTGknbPQrxf0mp1RO/rnLBKUMm0JvTX0qQTKOEFtydUT/VRaFn5u5He JOwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789491852; x=1790096652; 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=3wLYPADb7IYlvunm2zhGRsvnaxF2Q1CLllsL+hIEt2M=; b=nIZB8TQz3Zvg4ke5+46Nw8kUmOKs2l+ZL/5bf3mfUp4D/wzFp+cZG2A38t8NnVfUMU tjvXXE9oZa8f4fvu+00fzwvhbdMYf4xC9CYOZMuOSwKQFgKUDBbCrdYxnFrcw1B8ucyP 5YJ/fwk+TO4nt+iunfoaH1K3Mt7mQ6yU/Gv/QNfAOgtpNBdD3fxiPEkSw+O1Eq6B2xLx lo5L7X+QhA1beuecuigjqVHEd/kq1qlUhEZP/m2bHfRllHGT0hPnYZj9qi2j0xbUHZMc QSYsOwLe74LuQAPWTH+9SVP2fUhKoo96YG7wrg8QnYUOk7y1oaq7k1CNVCxB7/f5aNzP ehMg== X-Forwarded-Encrypted: i=1; AKwUvBwYY/8alS+DlBCJaK6jeKBvkhVu1UM25m4kS9XwECp49W+dxGjLMvaUB/WfleFOyU7IB1wC4nvMAShvpKs=@vger.kernel.org X-Gm-Message-State: AFuF++n2bGVSVnAAvX39J1HuP8zhhDG2vs1J/GCDkGwCJS+va2pZH0Jf at0gx9osPtWUYUnIr//Y+2zirrYDRf/aEVJNU0TOJT7Unee59wueRgsoX/M7HcTkgCpJ9I08xwJ n4nURNiSMsjenYTIueGiMRP9amt8P5wat3rMOjFZNWRu/6T29ACC2Qej1qCKN77xTywLLHuToer Y= X-Gm-Gg: AYBFou3WSC5Z75uTz7qYmpiSlPgOMnQ5CGQQ7PfsIS91aO7Y+pMcrOqscBTgYetGpgo WuRBfAwh9ZYvgy8rm7tSuxbPshZzrhqSC4pRplaYtNdtyvr0ls+UBxJ2ocPqfVPT/l9dh9mX/wa 8W66HdXNgHTMl/YL3Zdhf6cSQU8eiSjr7avDbwJhzblvI7TuP1y7p7TC6TYCIfz5OEJ2jZsjkgS pBzv+Zi4zvJItc5Emc0jZUEEV8r1R4Mpd6RPeD8ga6sPhQZR6//BH5meEa1UJa2zStMc+mbR4kL guIWbN1o8mmEs5VlB2R06XuHNXq6uT57zugwJc3ZHgrhtYxqX2UUOSGzkeLxWMeaVFj5ESiZufx KJ4NC4ytWi28dIKaxAuoXbCA= X-Received: by 2002:a05:6122:5312:b0:5c9:8bbb:3f13 with SMTP id 71dfb90a1353d-5c98bbb3fb6mr6243059e0c.7.1789491851874; Tue, 15 Sep 2026 10:04:11 -0700 (PDT) X-Received: by 2002:a05:6122:5312:b0:5c9:8bbb:3f13 with SMTP id 71dfb90a1353d-5c98bbb3fb6mr6242958e0c.7.1789491851294; Tue, 15 Sep 2026 10:04:11 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf27df9sm391286f8f.19.2026.09.15.10.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 10:04:10 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:51 +0200 Subject: [PATCH v4 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: <20260915-b4-dts-style-checker-continued-lines-v4-7-5b8e09b11ef2@oss.qualcomm.com> References: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@oss.qualcomm.com> In-Reply-To: <20260915-b4-dts-style-checker-continued-lines-v4-0-5b8e09b11ef2@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=18273; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=laSAp1YXGXDB0JNefD12jAWtTX1atEc/Z6Li1ZTRn+I=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBqqXp7vLmwbclfFzmk8lNPaXDeOMwsdToV/85i3 4zbSJcDj6eJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaql6ewAKCRDBN2bmhouD 1wuiEACZ7zQF+XsT1zw70+RqC+g4F8YXqjLWEZe7bqnv1XcHUWGXxm9k4Ytt+x6yItbYzlpYBOY T9mlGKgPaL1UprvYwyvJY92u2+NbS20ZYiwoR8/kuiMA6+o4GdqGXFwMFRSIYROV9ZM8eUDCY6P yQf4pERSPewQVNv4f97PrTbqrQDBYjfW2KbRtH15OH+K6C0Y55/HKJl59gn4CiXufSCEeBZzJ9I TnQEwUhptbPt7EBHHGWSQ5RlqDw+Pn0/8+w0Sg5bKU7Q7pNykVRKI4SJiDa6fkWt+Qqw2XdGOI4 +b1oe1fwLl2xIY7PeEVGAKuZkVBA4SQneUmgGylGleOXoD9spH+rAE4naM6L9a9U1z7eQOwmKTs aCppNDjNVixWHqn1KtEPkhpXcWDtiCXhdGMyeyAJIJqeZHf64xzL0q66OLHY+BKOhAYQuNAfIJN 9FAVZbwcV2NKSUUi1utT3hXnL/drnGQAl5DiDCOxr9Wcc7JwHgqeYs3HcPwk54GQH3lQPVy4af1 yCGZqorwQr934U8oYTk1lcMqxvu8t6xH2Nl8SWaXvIbt8dPbUMNQ2VlNyr6KuI0w8t9MS0itkR1 YXYS4YQXK7jqPOrKpc5PZZwuRj+IwpOmArAXeLEMoq1C/V4DIMrRzN8rgVVTS+H4dyePu3Dysw5 x7ly3X0rOrg445Q== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: 2vlXO8KBve3AyEmYow1WjhLWO8sx3Rvb X-Authority-Analysis: v=2.4 cv=cehHPXDM c=1 sm=1 tr=0 ts=6aa97a8d cx=c_pps a=+D9SDfe9YZWTjADjLiQY5g==:117 a=+bKQE0WJfmhK2875HamI0Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=hObz84sP8V3v96Jng0MA:9 a=QEXdDO2ut3YA:10 a=vmgOmaN-Xu0dpDh8OwbV:22 X-Proofpoint-GUID: 2vlXO8KBve3AyEmYow1WjhLWO8sx3Rvb X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX+0xSJK6mKYft ns9uKG90ZL5Rpo4niW+sB2PQpLJCeDMlAK4WJtIBVqReDiNc0+ti1XxJvk+oLKybLRgbxnOLmlJ iZfWLrARM4f2vmMp81V8KdhLmJqr2oc= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE1MDI0OSBTYWx0ZWRfX0VMvmGEngkHt +4eeAb26htceEu2pUV6UlIfyOZaS54F/BjUXzWWVAZesu1tc5fHlYbaIiGkDU4nKQy1h4kob5us MKgH2Tdj6wM3oz35wITxTVsSjtlF1yVSsDVXPdCGJvsNrsbCFub3neq1vm/JLjow2cfkWCCaVf5 yHLPaT7bKSscQ1BmvlmcnCTPFauS9QfG/lqCEFGMBlGDU4HrpJqMA13Tdk9BhDTdtSiqFfXaNFE iw1GmPOQtJv/1PtY6m8V18AqfrCAWqbT6fXmOW+7CJ2wFlfCimMweHfuf3gXVvvOxl07a7kF9cB XGF/gIlvdssXGIRM6H4FoKXRIvuUhxvDyUD+kNCF/qFElwCLvVnMlZ3vFCSULuiEMhZwO2Mpm6J Jk/ROgfcVsktBZOZTgFy9eGzOoCL47VmIXZrgax2IFCb04eX5rTxxOqM275WClv7HSPPm3RQjjM zC2w9J8xDhMKVdzTF9A== 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-15_04,2026-09-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 impostorscore=0 spamscore=0 phishscore=0 malwarescore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609150249 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/yaml-prop-order.yaml.txt | 1 + .../expected/yaml-prop-pairing.yaml.txt | 4 +- .../dt-style-selftest/good/dts-property-order.dts | 3 + .../dt-style-selftest/good/dts-property-order.dtso | 3 + 11 files changed, 89 insertions(+), 89 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 cbbb8d384aca..b8c40873905c 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')] @@ -803,33 +777,27 @@ def _pair_x_names(name, all_names): PAIRING_RULES =3D (_pair_pinctrl_names, _pair_x_names) =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: @@ -847,16 +815,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): @@ -1152,7 +1130,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/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 e6e21349a939..ee666559424a 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,3 +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:32: example 0 [property-order] property 'pinctr= l-0' out of canonical order (should sort before 'pinctrl-names') +bad/yaml-prop-pairing.yaml:29: example 0 [property-order] property 'clock-= names' must be placed after 'clocks' +bad/yaml-prop-pairing.yaml:31: 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