From 8fd24744e3618be99a939009349418fcbfa362b3 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 11 Oct 2021 14:12:44 -0500 Subject: [PATCH] checks: Ensure '#interrupt-cells' only exists in interrupt providers The interrupt provider check currently checks if an interrupt provider has #interrupt-cells, but not whether #interrupt-cells is present outside of interrupt-providers. Rework the check to cover the latter case. Cc: Andre Przywara Reviewed-by: David Gibson Signed-off-by: Rob Herring Message-Id: <20211011191245.1009682-4-robh@kernel.org> Signed-off-by: David Gibson --- checks.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/checks.c b/checks.c index c6eba76..b9fcde8 100644 --- a/checks.c +++ b/checks.c @@ -1573,14 +1573,20 @@ static void check_interrupt_provider(struct check *c, struct node *node) { struct property *prop; - - if (!node_is_interrupt_provider(node)) - return; + bool irq_provider = node_is_interrupt_provider(node); prop = get_property(node, "#interrupt-cells"); - if (!prop) + if (irq_provider && !prop) { FAIL(c, dti, node, - "Missing #interrupt-cells in interrupt provider"); + "Missing '#interrupt-cells' in interrupt provider"); + return; + } + + if (!irq_provider && prop) { + FAIL(c, dti, node, + "'#interrupt-cells' found, but node is not an interrupt provider"); + return; + } } WARNING(interrupt_provider, check_interrupt_provider, NULL, &interrupts_extended_is_cell);