diff options
author | John Powell <john.powell@arm.com> | 2020-03-20 14:21:05 -0500 |
---|---|---|
committer | johpow01 <john.powell@arm.com> | 2020-04-03 16:20:59 -0500 |
commit | 3443a7027d78a9ccebc6940f0a69300ec7c1ed44 (patch) | |
tree | 079c29b2f19a0009fdf7dbe2aa6727f920009a93 /bl2 | |
parent | 0f99bf32df156b7b87454278b049c65221eeeb84 (diff) |
Fix MISRA C issues in BL1/BL2/BL31
Attempts to address MISRA compliance issues in BL1, BL2, and BL31 code.
Mainly issues like not using boolean expressions in conditionals,
conflicting variable names, ignoring return values without (void), adding
explicit casts, etc.
Change-Id: If1fa18ab621b9c374db73fa6eaa6f6e5e55c146a
Signed-off-by: John Powell <john.powell@arm.com>
Diffstat (limited to 'bl2')
-rw-r--r-- | bl2/bl2_image_load_v2.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bl2/bl2_image_load_v2.c b/bl2/bl2_image_load_v2.c index 81d4b2bcc..48c9beca6 100644 --- a/bl2/bl2_image_load_v2.c +++ b/bl2/bl2_image_load_v2.c @@ -47,8 +47,9 @@ struct entry_point_info *bl2_load_images(void) * if indicated in the image attributes AND if NOT * already done before. */ - if (bl2_node_info->image_info->h.attr & IMAGE_ATTRIB_PLAT_SETUP) { - if (plat_setup_done) { + if ((bl2_node_info->image_info->h.attr & + IMAGE_ATTRIB_PLAT_SETUP) != 0U) { + if (plat_setup_done != 0) { WARN("BL2: Platform setup already done!!\n"); } else { INFO("BL2: Doing platform setup\n"); @@ -58,16 +59,17 @@ struct entry_point_info *bl2_load_images(void) } err = bl2_plat_handle_pre_image_load(bl2_node_info->image_id); - if (err) { + if (err != 0) { ERROR("BL2: Failure in pre image load handling (%i)\n", err); plat_error_handler(err); } - if (!(bl2_node_info->image_info->h.attr & IMAGE_ATTRIB_SKIP_LOADING)) { + if ((bl2_node_info->image_info->h.attr & + IMAGE_ATTRIB_SKIP_LOADING) == 0U) { INFO("BL2: Loading image id %d\n", bl2_node_info->image_id); err = load_auth_image(bl2_node_info->image_id, bl2_node_info->image_info); - if (err) { + if (err != 0) { ERROR("BL2: Failed to load image id %d (%i)\n", bl2_node_info->image_id, err); plat_error_handler(err); @@ -78,7 +80,7 @@ struct entry_point_info *bl2_load_images(void) /* Allow platform to handle image information. */ err = bl2_plat_handle_post_image_load(bl2_node_info->image_id); - if (err) { + if (err != 0) { ERROR("BL2: Failure in post image load handling (%i)\n", err); plat_error_handler(err); } |