devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: frowand.list@gmail.com
To: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] of: unittest: document intentional interrupt-map provider build warning
Date: Fri, 29 Oct 2021 20:10:39 -0500	[thread overview]
Message-ID: <20211030011039.2106946-1-frowand.list@gmail.com> (raw)

From: Frank Rowand <frank.rowand@sony.com>

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>
---
 .../of/unittest-data/tests-interrupts.dtsi    | 19 +++++++++++++++++++
 drivers/of/unittest.c                         |  6 ++++++
 2 files changed, 25 insertions(+)

diff --git a/drivers/of/unittest-data/tests-interrupts.dtsi b/drivers/of/unittest-data/tests-interrupts.dtsi
index 9b60a549f502..8c8d267d4d3c 100644
--- a/drivers/of/unittest-data/tests-interrupts.dtsi
+++ b/drivers/of/unittest-data/tests-interrupts.dtsi
@@ -31,6 +31,21 @@ test_intmap0: intmap0 {
 
 			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-interrupts_property to the Makefile
+				 * for all .dts files this include this .dtsi
+				#address-cells = <1>;
+				 */
 				interrupt-map = <0x5000 1 2 &test_intc0 15>;
 			};
 
@@ -46,6 +61,10 @@ interrupts1 {
 
 			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>,
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 8c056972a6dd..04bfef8f67c3 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -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);
-- 
Frank Rowand <frank.rowand@sony.com>


             reply	other threads:[~2021-10-30  1:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-30  1:10 frowand.list [this message]
2021-11-01 13:31 ` [PATCH 1/1] of: unittest: document intentional interrupt-map provider build warning Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211030011039.2106946-1-frowand.list@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).