Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: unittest: document intentional interrupt-map provider build warning

A recently implemented dtc compiler warning reports a dts problem
via a build warning:

drivers/of/unittest-data/tests-interrupts.dtsi:32.26-35.6: Warning (interrupt_map): /testcase-data/interrupts/intmap1: Missing '#address-cells' in interrupt-map provider

The warning will be addressed by a separate patch by suppressing the
warning for .dts files that include this .dtsi. This patch documents
why the warning is due to a deliberately incorrect .dtsi file so that
no one will fix the .dtsi file to prevent the build warning.

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Link: https://lore.kernel.org/r/20211030011039.2106946-1-frowand.list@gmail.com
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Frank Rowand and committed by
Rob Herring
95265655 e85860e5

+25
+19
drivers/of/unittest-data/tests-interrupts.dtsi
··· 31 31 32 32 test_intmap1: intmap1 { 33 33 #interrupt-cells = <2>; 34 + /* 35 + * #address-cells is required 36 + * 37 + * The property is not provided in this node to 38 + * test that the code will properly handle 39 + * this case for legacy .dts files. 40 + * 41 + * Not having #address-cells will result in a 42 + * warning from dtc starting with 43 + * version v1.6.1-19-g0a3a9d3449c8 44 + * The warning is suppressed by adding 45 + * -Wno-interrupt_map to the Makefile for all 46 + * .dts files this include this .dtsi 47 + #address-cells = <1>; 48 + */ 34 49 interrupt-map = <0x5000 1 2 &test_intc0 15>; 35 50 }; 36 51 ··· 61 46 62 47 interrupts-extended0 { 63 48 reg = <0x5000 0x100>; 49 + /* 50 + * Do not remove &test_intmap1 from this 51 + * property - see comment in node intmap1 52 + */ 64 53 interrupts-extended = <&test_intc0 1>, 65 54 <&test_intc1 2 3 4>, 66 55 <&test_intc2 5 6>,
+6
drivers/of/unittest.c
··· 1129 1129 passed &= (args.args[1] == 14); 1130 1130 break; 1131 1131 case 6: 1132 + /* 1133 + * Tests child node that is missing property 1134 + * #address-cells. See the comments in 1135 + * drivers/of/unittest-data/tests-interrupts.dtsi 1136 + * nodes intmap1 and interrupts-extended0 1137 + */ 1132 1138 passed &= !rc; 1133 1139 passed &= (args.args_count == 1); 1134 1140 passed &= (args.args[0] == 15);