From 2fe75a2de087ec23162c5fd25ba439bd330ea50c Mon Sep 17 00:00:00 2001 From: Zelalem Date: Wed, 12 Feb 2020 10:37:03 -0600 Subject: coverity: fix MISRA violations Fixes for the following MISRA violations: - Missing explicit parentheses on sub-expression - An identifier or macro name beginning with an underscore, shall not be declared - Type mismatch in BL1 SMC handlers and tspd_main.c Change-Id: I7a92abf260da95acb0846b27c2997b59b059efc4 Signed-off-by: Zelalem --- include/bl1/bl1.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/bl1/bl1.h') diff --git a/include/bl1/bl1.h b/include/bl1/bl1.h index d81f43404..e6447f25b 100644 --- a/include/bl1/bl1.h +++ b/include/bl1/bl1.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -67,16 +67,16 @@ struct entry_point_info; -register_t bl1_smc_wrapper(uint32_t smc_fid, +u_register_t bl1_smc_wrapper(uint32_t smc_fid, void *cookie, void *handle, unsigned int flags); -register_t bl1_smc_handler(unsigned int smc_fid, - register_t x1, - register_t x2, - register_t x3, - register_t x4, +u_register_t bl1_smc_handler(unsigned int smc_fid, + u_register_t x1, + u_register_t x2, + u_register_t x3, + u_register_t x4, void *cookie, void *handle, unsigned int flags); -- cgit v1.2.3 From e1d5be56ba0f159534f20137401676f6ea697828 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Wed, 5 Aug 2020 15:33:40 -0500 Subject: Specify signed-ness of constants We relyed on the default signed-ness of constants, which is usually signed. This can create MISRA violations, such as: bl1/bl1_main.c:257:[MISRA C-2012 10.8 (required)] Cast of composite expression off essential type signed to essential type unsigned These constants were only used as unsigned, so this patch makes them explicitly unsigned. Change-Id: I5f1310c881e936077035fbb1d5ffb449b45de3ad Signed-off-by: Jimmy Brisson --- include/bl1/bl1.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/bl1/bl1.h') diff --git a/include/bl1/bl1.h b/include/bl1/bl1.h index e6447f25b..21d3ae7b7 100644 --- a/include/bl1/bl1.h +++ b/include/bl1/bl1.h @@ -26,8 +26,8 @@ /* * BL1 SMC version */ -#define BL1_SMC_MAJOR_VER 0x0 -#define BL1_SMC_MINOR_VER 0x1 +#define BL1_SMC_MAJOR_VER UL(0x0) +#define BL1_SMC_MINOR_VER UL(0x1) /* * Defines for FWU SMC function ids. -- cgit v1.2.3