summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2018-02-21 01:16:39 +0000
committerSoby Mathew <soby.mathew@arm.com>2018-02-26 16:31:11 +0000
commitda5f274572c063962556821914e2f64db5ae3d2d (patch)
tree0a23e2f3c17a912c7374e41a179a7a96d7136f40 /common
parentce6d9643ad9c83b9183ea3f910aee88a22b13532 (diff)
Dynamic cfg: MISRA fixes
Change-Id: I1d85b76af002b8b672fcaeca94939b7420bc8243 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Diffstat (limited to 'common')
-rw-r--r--common/desc_image_load.c2
-rw-r--r--common/fdt_wrappers.c28
2 files changed, 15 insertions, 15 deletions
diff --git a/common/desc_image_load.c b/common/desc_image_load.c
index 147dfbff..672b80b0 100644
--- a/common/desc_image_load.c
+++ b/common/desc_image_load.c
@@ -202,7 +202,7 @@ void populate_next_bl_params_config(bl_params_t *bl2_to_next_bl_params)
uintptr_t hw_config_base = 0, fw_config_base;
bl_mem_params_node_t *mem_params;
- assert(bl2_to_next_bl_params);
+ assert(bl2_to_next_bl_params != NULL);
/*
* Get the `bl_mem_params_node_t` corresponding to HW_CONFIG
diff --git a/common/fdt_wrappers.c b/common/fdt_wrappers.c
index 37660194..1a726a8a 100644
--- a/common/fdt_wrappers.c
+++ b/common/fdt_wrappers.c
@@ -23,16 +23,16 @@ int fdtw_read_cells(const void *dtb, int node, const char *prop,
uint32_t hi = 0, lo;
int value_len;
- assert(dtb);
- assert(prop);
- assert(value);
+ assert(dtb != NULL);
+ assert(prop != NULL);
+ assert(value != NULL);
assert(node >= 0);
/* We expect either 1 or 2 cell property */
- assert(cells <= 2);
+ assert(cells <= 2U);
/* Access property and obtain its length (in bytes) */
- value_ptr = fdt_getprop_namelen(dtb, node, prop, strlen(prop),
+ value_ptr = fdt_getprop_namelen(dtb, node, prop, (int)strlen(prop),
&value_len);
if (value_ptr == NULL) {
WARN("Couldn't find property %s in dtb\n", prop);
@@ -41,19 +41,19 @@ int fdtw_read_cells(const void *dtb, int node, const char *prop,
/* Verify that property length accords with cell length */
- if (NCELLS(value_len) != cells) {
+ if (NCELLS((unsigned int)value_len) != cells) {
WARN("Property length mismatch\n");
return -1;
}
- if (cells == 2) {
+ if (cells == 2U) {
hi = fdt32_to_cpu(*value_ptr);
value_ptr++;
}
lo = fdt32_to_cpu(*value_ptr);
- if (cells == 2)
+ if (cells == 2U)
*((uint64_t *) value) = ((uint64_t) hi << 32) | lo;
else
*((uint32_t *) value) = lo;
@@ -70,20 +70,20 @@ int fdtw_write_inplace_cells(void *dtb, int node, const char *prop,
{
int err, len;
- assert(dtb);
- assert(prop);
- assert(value);
+ assert(dtb != NULL);
+ assert(prop != NULL);
+ assert(value != NULL);
assert(node >= 0);
/* We expect either 1 or 2 cell property */
- assert(cells <= 2);
+ assert(cells <= 2U);
- if (cells == 2)
+ if (cells == 2U)
*(uint64_t *)value = cpu_to_fdt64(*(uint64_t *)value);
else
*(uint32_t *)value = cpu_to_fdt32(*(uint32_t *)value);
- len = cells * 4;
+ len = (int)cells * 4;
/* Set property value in place */
err = fdt_setprop_inplace(dtb, node, prop, value, len);