aboutsummaryrefslogtreecommitdiff
path: root/product/rdn1e1
diff options
context:
space:
mode:
authorJim Quigley <jim.quigley@arm.com>2020-03-05 18:25:27 +0000
committernicola-mazzucato-arm <42373140+nicola-mazzucato-arm@users.noreply.github.com>2020-03-12 17:23:30 +0000
commita366c5c6da1a93a9f374784fb9a6af0edb4027fd (patch)
tree270d41194774a04112a9be40863fabc1b9199a9f /product/rdn1e1
parentc24d8666b033d87e02d2cec5b3fb031d6aa63a8d (diff)
fwk/fwk_mm_alloc: panic if memory allocation failed
Currently the framework will return NULL if the memory allocation fails. As the system will ultimately fail on receiving the error we could just panic instead, saving the memory used for the NULL checks. Change-Id: I731b87b7acb19d30df84936b07c76cbfe0d0726e Signed-off-by: Jim Quigley <jim.quigley@arm.com>
Diffstat (limited to 'product/rdn1e1')
-rw-r--r--product/rdn1e1/scp_ramfw/config_power_domain.c6
-rw-r--r--product/rdn1e1/scp_ramfw/config_ppu_v1.c8
2 files changed, 0 insertions, 14 deletions
diff --git a/product/rdn1e1/scp_ramfw/config_power_domain.c b/product/rdn1e1/scp_ramfw/config_power_domain.c
index b1b4a369..d7a4c0c1 100644
--- a/product/rdn1e1/scp_ramfw/config_power_domain.c
+++ b/product/rdn1e1/scp_ramfw/config_power_domain.c
@@ -153,13 +153,9 @@ static const struct fwk_element *rdn1e1_power_domain_get_element_table
+ FWK_ARRAY_SIZE(rdn1e1_power_domain_static_element_table)
+ 1, /* Terminator */
sizeof(struct fwk_element));
- if (element_table == NULL)
- return NULL;
pd_config_table = fwk_mm_calloc(core_count,
sizeof(struct mod_power_domain_element_config));
- if (pd_config_table == NULL)
- return NULL;
for (cluster_idx = 0; cluster_idx < cluster_count; cluster_idx++) {
for (core_idx = 0;
@@ -170,8 +166,6 @@ static const struct fwk_element *rdn1e1_power_domain_get_element_table
pd_config = &pd_config_table[core_element_count];
element->name = fwk_mm_alloc(PD_NAME_SIZE, 1);
- if (element->name == NULL)
- return NULL;
snprintf((char *)element->name, PD_NAME_SIZE, "CLUS%uCORE%u",
cluster_idx, core_idx);
diff --git a/product/rdn1e1/scp_ramfw/config_ppu_v1.c b/product/rdn1e1/scp_ramfw/config_ppu_v1.c
index 6c114cf8..0b5ec83d 100644
--- a/product/rdn1e1/scp_ramfw/config_ppu_v1.c
+++ b/product/rdn1e1/scp_ramfw/config_ppu_v1.c
@@ -81,13 +81,9 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
element_table = fwk_mm_calloc(core_count + cluster_count +
FWK_ARRAY_SIZE(ppu_v1_system_element_table) + 1,
sizeof(struct fwk_element));
- if (element_table == NULL)
- return NULL;
pd_config_table = fwk_mm_calloc(core_count + cluster_count,
sizeof(struct mod_ppu_v1_pd_config));
- if (pd_config_table == NULL)
- return NULL;
for (cluster_idx = 0; cluster_idx < cluster_count; cluster_idx++) {
for (core_idx = 0;
@@ -97,8 +93,6 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
pd_config = &pd_config_table[core_element_count];
element->name = fwk_mm_alloc(PPU_CORE_NAME_SIZE, 1);
- if (element->name == NULL)
- return NULL;
snprintf((char *)element->name, PPU_CORE_NAME_SIZE, "CLUS%uCORE%u",
cluster_idx, core_idx);
@@ -119,8 +113,6 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
pd_config = &pd_config_table[core_count + cluster_idx];
element->name = fwk_mm_alloc(PPU_CLUS_NAME_SIZE, 1);
- if (element->name == NULL)
- return NULL;
snprintf((char *)element->name, PPU_CLUS_NAME_SIZE, "CLUS%u",
cluster_idx);