From 793019b98d837041d8d036fa06575d6c39ef9c50 Mon Sep 17 00:00:00 2001 From: Mohamed Omar Asaker Date: Mon, 19 May 2025 17:49:10 +0100 Subject: [PATCH] mod/xr77128: Extend get_dev_ctx to support sub-element IDs Previously, get_dev_ctx was restricted to accepting only element IDs due to an assert check. However, in release builds, it functions correctly with both element and sub-element IDs. This change updates the assert to explicitly allow sub-element IDs as well. Signed-off-by: Mohamed Omar Asaker --- module/xr77128/src/mod_xr77128.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/xr77128/src/mod_xr77128.c b/module/xr77128/src/mod_xr77128.c index 25c9cca96..03729f118 100644 --- a/module/xr77128/src/mod_xr77128.c +++ b/module/xr77128/src/mod_xr77128.c @@ -1,6 +1,6 @@ /* * Arm SCP/MCP Software - * Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2023-2025, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause * @@ -156,7 +156,9 @@ static struct xr77128_module_ctx module_ctx; /* Module helpers */ static struct xr77128_dev_ctx *get_dev_ctx(fwk_id_t id) { - fwk_assert(fwk_module_is_valid_element_id(id)); + fwk_assert( + fwk_module_is_valid_element_id(id) || + fwk_module_is_valid_sub_element_id(id)); return &(module_ctx.dev_ctx_table[fwk_id_get_element_idx(id)]); } -- GitLab