Fix MISRA rule 8.3 Part 4
authorRoberto Vargas <roberto.vargas@arm.com>
Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)
committerRoberto Vargas <roberto.vargas@arm.com>
Fri, 13 Apr 2018 13:01:56 +0000 (14:01 +0100)
Rule 8.3: All declarations of an object or function shall
          use the same names and type qualifiers

Fixed for:
make DEBUG=1 PLAT=fvp SPD=tspd TRUSTED_BOARD_BOOT=1 \
     GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
     ROT_KEY=arm_rotprivk_rsa.pem MBEDTLS_DIR=mbedtls all

Change-Id: Ia34fe1ae1f142e89c9a6c19831e3daf4d28f5831
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
bl1/bl1_fwu.c
drivers/auth/auth_mod.c
include/common/tbbr/tbbr_img_def.h
include/drivers/auth/auth_mod.h
include/drivers/auth/crypto_mod.h
include/drivers/auth/img_parser_mod.h

index 49e4e8e25cb4f814278f7216b5cf3eb7dc879679..25be57708f7029820f9bc4639cc828c7fe83de1f 100644 (file)
  * Function declarations.
  */
 static int bl1_fwu_image_copy(unsigned int image_id,
-                       uintptr_t image_addr,
+                       uintptr_t image_src,
                        unsigned int block_size,
                        unsigned int image_size,
                        unsigned int flags);
 static int bl1_fwu_image_auth(unsigned int image_id,
-                       uintptr_t image_addr,
+                       uintptr_t image_src,
                        unsigned int image_size,
                        unsigned int flags);
 static int bl1_fwu_image_execute(unsigned int image_id,
@@ -50,7 +50,7 @@ __dead2 static void bl1_fwu_done(void *client_cookie, void *reserved);
 static unsigned int sec_exec_image_id = INVALID_IMAGE_ID;
 
 /* Authentication status of each image. */
-extern unsigned int auth_img_flags[];
+extern unsigned int auth_img_flags[MAX_NUMBER_IDS];
 
 /*******************************************************************************
  * Top level handler for servicing FWU SMCs.
index 1cea60b220deab682fa2449ab64383e3bcc03361..eb537b66a1065343f066d8d92d8888137d81b7ae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -30,7 +30,7 @@
 
 /* Pointer to CoT */
 extern const auth_img_desc_t *const cot_desc_ptr;
-extern unsigned int auth_img_flags[];
+extern unsigned int auth_img_flags[MAX_NUMBER_IDS];
 
 static int cmp_auth_param_type_desc(const auth_param_type_desc_t *a,
                const auth_param_type_desc_t *b)
index 060198bc149a506ed09210b3541e9eb2a81fcd9a..273abbea060b3f961d9db3f70a8faa067b58ed77 100644 (file)
@@ -75,4 +75,7 @@
 /* NT_FW_CONFIG */
 #define NT_FW_CONFIG_ID                27
 
+/* Define size of the array */
+#define MAX_NUMBER_IDS                 28
+
 #endif /* __TBBR_IMG_DEF_H__ */
index bd65098036d2e5ce5d8be4f8ef16b87ca6c13972..74fc15fc16eb8e674b85ca8cd46d0e6387c18db9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -12,6 +12,7 @@
 #include <auth_common.h>
 #include <cot_def.h>
 #include <img_parser_mod.h>
+#include <tbbr_img_def.h>
 
 /*
  * Image flags
@@ -41,7 +42,7 @@ int auth_mod_verify_img(unsigned int img_id,
 #define REGISTER_COT(_cot) \
        const auth_img_desc_t *const cot_desc_ptr = \
                        (const auth_img_desc_t *const)&_cot[0]; \
-       unsigned int auth_img_flags[sizeof(_cot)/sizeof(_cot[0])]
+       unsigned int auth_img_flags[MAX_NUMBER_IDS]
 
 #endif /* TRUSTED_BOARD_BOOT */
 
index 08884ab2218a55ba80ad79e170c6e1689f7dad9f..7a1b6b807a2e2b479c7748b8147875fa1a781b3e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -43,7 +43,7 @@ typedef struct crypto_lib_desc_s {
 void crypto_mod_init(void);
 int crypto_mod_verify_signature(void *data_ptr, unsigned int data_len,
                                void *sig_ptr, unsigned int sig_len,
-                               void *sig_alg, unsigned int sig_alg_len,
+                               void *sig_alg_ptr, unsigned int sig_alg_len,
                                void *pk_ptr, unsigned int pk_len);
 int crypto_mod_verify_hash(void *data_ptr, unsigned int data_len,
                           void *digest_info_ptr, unsigned int digest_info_len);
index 347ed621cf149d99ccb569e473ca894287ef5d4c..eaf3e6e7abf164cc668406d24a9954a278ca9eef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -44,10 +44,10 @@ typedef struct img_parser_lib_desc_s {
 /* Exported functions */
 void img_parser_init(void);
 int img_parser_check_integrity(img_type_t img_type,
-               void *img, unsigned int img_len);
+               void *img_ptr, unsigned int img_len);
 int img_parser_get_auth_param(img_type_t img_type,
                const auth_param_type_desc_t *type_desc,
-               void *img, unsigned int img_len,
+               void *img_ptr, unsigned int img_len,
                void **param_ptr, unsigned int *param_len);
 
 /* Macro to register an image parser library */