Browse Source

fix(zynqmp): resolve the misra 4.6 warnings

MISRA Violation: MISRA-C:2012 R.4.6
- Using basic numerical type int rather than a typedef
that includes size and signedness information.

Change-Id: Id85e69b29b124052b4a87462ce27fcdfc00c13c9
Signed-off-by: HariBabu Gattem <haribabu.gattem@amd.com>
pull/1988/head
HariBabu Gattem 2 years ago
parent
commit
15dc3e4f8d
  1. 12
      plat/xilinx/common/include/ipi.h
  2. 2
      plat/xilinx/common/ipi.c
  3. 2
      plat/xilinx/common/pm_service/pm_ipi.c
  4. 2
      plat/xilinx/zynqmp/pm_service/pm_api_clock.c
  5. 18
      plat/xilinx/zynqmp/pm_service/pm_api_clock.h
  6. 4
      plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c
  7. 6
      plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.h
  8. 26
      plat/xilinx/zynqmp/pm_service/pm_defs.h

12
plat/xilinx/common/include/ipi.h

@ -14,20 +14,20 @@
/*********************************************************************
* IPI mailbox status macros
********************************************************************/
#define IPI_MB_STATUS_IDLE 0
#define IPI_MB_STATUS_SEND_PENDING 1
#define IPI_MB_STATUS_RECV_PENDING 2
#define IPI_MB_STATUS_IDLE (0U)
#define IPI_MB_STATUS_SEND_PENDING (1U)
#define IPI_MB_STATUS_RECV_PENDING (2U)
/*********************************************************************
* IPI mailbox call is secure or not macros
********************************************************************/
#define IPI_MB_CALL_NOTSECURE 0
#define IPI_MB_CALL_SECURE 1
#define IPI_MB_CALL_NOTSECURE (0U)
#define IPI_MB_CALL_SECURE (1U)
/*********************************************************************
* IPI secure check
********************************************************************/
#define IPI_SECURE_MASK 0x1U
#define IPI_SECURE_MASK (0x1U)
#define IPI_IS_SECURE(I) ((ipi_table[(I)].secure_only & \
IPI_SECURE_MASK) ? 1 : 0)

2
plat/xilinx/common/ipi.c

@ -141,7 +141,7 @@ void ipi_mb_release(uint32_t local, uint32_t remote)
*/
int ipi_mb_enquire_status(uint32_t local, uint32_t remote)
{
int ret = 0;
int ret = 0U;
uint32_t status;
status = mmio_read_32(IPI_REG_BASE(local) + IPI_OBR_OFFSET);

2
plat/xilinx/common/pm_service/pm_ipi.c

@ -18,7 +18,7 @@
#include "pm_defs.h"
#include "pm_ipi.h"
#define ERROR_CODE_MASK 0xFFFFU
#define ERROR_CODE_MASK (0xFFFFU)
DEFINE_BAKERY_LOCK(pm_secure_lock);

2
plat/xilinx/zynqmp/pm_service/pm_api_clock.c

@ -2400,7 +2400,7 @@ static bool pm_clock_valid(uint32_t clock_id)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(pm_clk_invalid_list); i++)
for (i = 0U; i < ARRAY_SIZE(pm_clk_invalid_list); i++)
if (pm_clk_invalid_list[i] == clock_id)
return 0;

18
plat/xilinx/zynqmp/pm_service/pm_api_clock.h

@ -15,19 +15,19 @@
#include "pm_common.h"
#define CLK_NAME_LEN U(15)
#define MAX_PARENTS U(100)
#define CLK_NAME_LEN (15U)
#define MAX_PARENTS (100U)
#define CLK_NA_PARENT -1
#define CLK_DUMMY_PARENT -2
/* Flags for parent id */
#define PARENT_CLK_SELF U(0)
#define PARENT_CLK_NODE1 U(1)
#define PARENT_CLK_NODE2 U(2)
#define PARENT_CLK_NODE3 U(3)
#define PARENT_CLK_NODE4 U(4)
#define PARENT_CLK_EXTERNAL U(5)
#define PARENT_CLK_MIO0_MIO77 U(6)
#define PARENT_CLK_SELF (0U)
#define PARENT_CLK_NODE1 (1U)
#define PARENT_CLK_NODE2 (2U)
#define PARENT_CLK_NODE3 (3U)
#define PARENT_CLK_NODE4 (4U)
#define PARENT_CLK_EXTERNAL (5U)
#define PARENT_CLK_MIO0_MIO77 (6U)
#define CLK_SET_RATE_GATE BIT(0) /* must be gated across rate change */
#define CLK_SET_PARENT_GATE BIT(1) /* must be gated across re-parent */

4
plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c

@ -2037,7 +2037,7 @@ enum pm_ret_status pm_api_pinctrl_get_function_groups(uint32_t fid,
{
uint16_t grps;
uint16_t end_of_grp_offset;
unsigned int i;
uint16_t i;
if (fid >= MAX_FUNCTION) {
return PM_RET_ERROR_ARGS;
@ -2048,7 +2048,7 @@ enum pm_ret_status pm_api_pinctrl_get_function_groups(uint32_t fid,
grps = pinctrl_functions[fid].group_base;
end_of_grp_offset = grps + pinctrl_functions[fid].group_size;
for (i = 0; i < NUM_GROUPS_PER_RESP; i++) {
for (i = 0U; i < NUM_GROUPS_PER_RESP; i++) {
if ((grps + index + i) >= end_of_grp_offset) {
break;
}

6
plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.h

@ -13,9 +13,9 @@
#include "pm_common.h"
#define FUNCTION_NAME_LEN U(16)
#define GROUPS_PAYLOAD_LEN U(12)
#define NUM_GROUPS_PER_RESP U(6)
#define FUNCTION_NAME_LEN (16U)
#define GROUPS_PAYLOAD_LEN (12U)
#define NUM_GROUPS_PER_RESP (6U)
#define END_OF_FUNCTION "END_OF_FUNCTION"
#define END_OF_GROUPS -1
#define PINCTRL_GRP_RESERVED -2

26
plat/xilinx/zynqmp/pm_service/pm_defs.h

@ -256,19 +256,19 @@ enum pm_opchar_type {
* @PM_RET_ERROR_NODE_USED: node is already in use
*/
enum pm_ret_status {
PM_RET_SUCCESS,
PM_RET_ERROR_ARGS = 1,
PM_RET_ERROR_NOTSUPPORTED = 4,
PM_RET_ERROR_NOT_ENABLED = 29,
PM_RET_ERROR_INTERNAL = 2000,
PM_RET_ERROR_CONFLICT = 2001,
PM_RET_ERROR_ACCESS = 2002,
PM_RET_ERROR_INVALID_NODE = 2003,
PM_RET_ERROR_DOUBLE_REQ = 2004,
PM_RET_ERROR_ABORT_SUSPEND = 2005,
PM_RET_ERROR_TIMEOUT = 2006,
PM_RET_ERROR_NODE_USED = 2007,
PM_RET_ERROR_NO_FEATURE = 2008
PM_RET_SUCCESS = (0U),
PM_RET_ERROR_ARGS = (1U),
PM_RET_ERROR_NOTSUPPORTED = (4U),
PM_RET_ERROR_NOT_ENABLED = (29U),
PM_RET_ERROR_INTERNAL = (2000U),
PM_RET_ERROR_CONFLICT = (2001U),
PM_RET_ERROR_ACCESS = (2002U),
PM_RET_ERROR_INVALID_NODE = (2003U),
PM_RET_ERROR_DOUBLE_REQ = (2004U),
PM_RET_ERROR_ABORT_SUSPEND = (2005U),
PM_RET_ERROR_TIMEOUT = (2006U),
PM_RET_ERROR_NODE_USED = (2007U),
PM_RET_ERROR_NO_FEATURE = (2008U)
};
/**

Loading…
Cancel
Save