Skip to content

Commit 1f74413

Browse files
krzkrobherring
authored andcommitted
docs: dt-bindings: Document preferred line wrapping
There are some patches with long lines as a result of checkpatch enforcing 100, not 80, but checkpatch is only a tool not a coding style. The Linux Kernel Coding Style is still clear here on preferred limit. Mentioned preferred style of wrapping long lines in DTS, based on Linux Kernel Coding Style. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 54f6052 commit 1f74413

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Documentation/devicetree/bindings/dts-coding-style.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,27 @@ Example::
162162
status = "okay";
163163
}
164164

165-
Indentation
166-
-----------
165+
Indentation and wrapping
166+
------------------------
167167

168-
1. Use indentation according to Documentation/process/coding-style.rst.
168+
1. Use indentation and wrap lines according to
169+
Documentation/process/coding-style.rst.
169170
2. Each entry in arrays with multiple cells, e.g. "reg" with two IO addresses,
170171
shall be enclosed in <>.
171-
3. For arrays spanning across lines, it is preferred to align the continued
172-
entries with opening < from the first line.
172+
3. For arrays spanning across lines, it is preferred to split on item boundary
173+
and align the continued entries with opening < from the first line.
174+
Usually avoid splitting individual items unless they significantly exceed
175+
line wrap limit.
173176

174177
Example::
175178

176179
thermal-sensor@c271000 {
177180
compatible = "qcom,sm8550-tsens", "qcom,tsens-v2";
178181
reg = <0x0 0x0c271000 0x0 0x1000>,
179182
<0x0 0x0c222000 0x0 0x1000>;
183+
/* Lines exceeding coding style line wrap limit: */
184+
interconnects = <&aggre1_noc MASTER_USB3_0 0 &mc_virt SLAVE_EBI1 0>,
185+
<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_0 0>;
180186
};
181187

182188
Organizing DTSI and DTS

0 commit comments

Comments
 (0)