SPM: Refine the get_irq_line_for_signal function
This patch moves the signal bit check from calller to
get_irq_line_for_signal().
The check should have been included in the function.
Change-Id: Ic2b850ecc02ed3ce6477781cfcf213b5aa202db7
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/spm/cmsis_func/spm_func.c b/secure_fw/spm/cmsis_func/spm_func.c
index 35702b2..17f0136 100644
--- a/secure_fw/spm/cmsis_func/spm_func.c
+++ b/secure_fw/spm/cmsis_func/spm_func.c
@@ -1087,6 +1087,10 @@
{
size_t i;
+ if (!tfm_is_one_bit_set(signal)) {
+ return -1;
+ }
+
for (i = 0; i < tfm_core_irq_signals_count; ++i) {
if (tfm_core_irq_signals[i].partition_id == partition_id &&
tfm_core_irq_signals[i].signal_value == signal) {
@@ -1107,12 +1111,6 @@
tfm_spm_partition_get_partition_id(running_partition_idx);
int32_t irq_line;
- /* Only a single signal is allowed */
- if (!tfm_is_one_bit_set(irq_signal)) {
- /* FixMe: error severity TBD */
- tfm_secure_api_error_handler();
- }
-
irq_line = get_irq_line_for_signal(running_partition_id, irq_signal);
if (irq_line < 0) {
@@ -1134,12 +1132,6 @@
tfm_spm_partition_get_partition_id(running_partition_idx);
int32_t irq_line;
- /* Only a single signal is allowed */
- if (!tfm_is_one_bit_set(irq_signal)) {
- /* FixMe: error severity TBD */
- tfm_secure_api_error_handler();
- }
-
irq_line = get_irq_line_for_signal(running_partition_id, irq_signal);
if (irq_line < 0) {
@@ -1197,11 +1189,6 @@
tfm_spm_partition_get_partition_id(running_partition_idx);
curr_part_data = tfm_spm_partition_get_runtime_data(running_partition_idx);
- /* Only a single signal is allowed */
- if (!tfm_is_one_bit_set(irq_signal)) {
- tfm_secure_api_error_handler();
- }
-
irq_line = get_irq_line_for_signal(running_partition_id, irq_signal);
if (irq_line < 0) {