From: "Rob Herring (Arm)" <robh@kernel.org>
To: devicetree-compiler@vger.kernel.org
Subject: [PATCH] checks: Check the overall length of "interrupt-map"
Date: Fri, 31 May 2024 08:31:49 -0500 [thread overview]
Message-ID: <20240531133149.1498139-1-robh@kernel.org> (raw)
It is possible the overall length of "interrupt-map" is shorter than
expected. A likely scenario is if "#address-cells" in the interrupt
parent is not accounted for and there is only a single map entry. With
multiple entries, one of the other tests would likely fail.
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
checks.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/checks.c b/checks.c
index 28f86ccff56b..1950c18dd333 100644
--- a/checks.c
+++ b/checks.c
@@ -1677,6 +1677,10 @@ static void check_interrupt_map(struct check *c,
parent_cellsize += propval_cell(cellprop);
cell += 1 + parent_cellsize;
+ if (cell > map_cells)
+ FAIL_PROP(c, dti, node, irq_map_prop,
+ "property size (%d) mismatch, expected %zu",
+ irq_map_prop->val.len, cell * sizeof(cell_t));
}
}
WARNING(interrupt_map, check_interrupt_map, NULL, &phandle_references, &addr_size_cells, &interrupt_provider);
--
2.43.0
next reply other threads:[~2024-05-31 13:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-31 13:31 Rob Herring (Arm) [this message]
2024-06-01 8:31 ` [PATCH] checks: Check the overall length of "interrupt-map" David Gibson
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=20240531133149.1498139-1-robh@kernel.org \
--to=robh@kernel.org \
--cc=devicetree-compiler@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.