]> git.baikalelectronics.ru Git - kernel.git/commitdiff
of: unittest: document intentional interrupt-map provider build warning
authorFrank Rowand <frank.rowand@sony.com>
Sat, 30 Oct 2021 01:10:39 +0000 (20:10 -0500)
committerRob Herring <robh@kernel.org>
Tue, 2 Nov 2021 01:33:56 +0000 (20:33 -0500)
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>
drivers/of/unittest-data/tests-interrupts.dtsi
drivers/of/unittest.c

index 9b60a549f5020427af211309c80d19536152322c..ecc74dbcc373f655214d055446f50ca591f70a35 100644 (file)
 
                        test_intmap1: intmap1 {
                                #interrupt-cells = <2>;
+                               /*
+                                * #address-cells is required
+                                *
+                                * The property is not provided in this node to
+                                * test that the code will properly handle
+                                * this case for legacy .dts files.
+                                *
+                                * Not having #address-cells will result in a
+                                * warning from dtc starting with
+                                * version v1.6.1-19-g0a3a9d3449c8
+                                * The warning is suppressed by adding
+                                * -Wno-interrupt_map to the Makefile for all
+                                * .dts files this include this .dtsi
+                               #address-cells = <1>;
+                                */
                                interrupt-map = <0x5000 1 2 &test_intc0 15>;
                        };
 
 
                        interrupts-extended0 {
                                reg = <0x5000 0x100>;
+                               /*
+                                * Do not remove &test_intmap1 from this
+                                * property - see comment in node intmap1
+                                */
                                interrupts-extended = <&test_intc0 1>,
                                                      <&test_intc1 2 3 4>,
                                                      <&test_intc2 5 6>,
index c12bcb5cca6077802952095842dd90f3800a1a83..481ba8682ebf418bfd1b6d566a3cee8f1e66fd6e 100644 (file)
@@ -1129,6 +1129,12 @@ static void __init of_unittest_parse_interrupts_extended(void)
                        passed &= (args.args[1] == 14);
                        break;
                case 6:
+                       /*
+                        * Tests child node that is missing property
+                        * #address-cells.  See the comments in
+                        * drivers/of/unittest-data/tests-interrupts.dtsi
+                        * nodes intmap1 and interrupts-extended0
+                        */
                        passed &= !rc;
                        passed &= (args.args_count == 1);
                        passed &= (args.args[0] == 15);