diff --git a/plat/arm/css/drivers/scmi/scmi_private.h b/plat/arm/css/drivers/scmi/scmi_private.h index a07841ee393d98a767e8877c927d9210a1a6ced9..67fe7481ff48085b6cc4f7288933881a3f6b6682 100644 --- a/plat/arm/css/drivers/scmi/scmi_private.h +++ b/plat/arm/css/drivers/scmi/scmi_private.h @@ -60,14 +60,14 @@ * Helper macro to create an SCMI message header given protocol, message id * and token. */ -#define SCMI_MSG_CREATE(protocol, msg_id, token) \ - ((((protocol) & SCMI_MSG_PROTO_ID_MASK) << SCMI_MSG_PROTO_ID_SHIFT) | \ - (((msg_id) & SCMI_MSG_ID_MASK) << SCMI_MSG_ID_SHIFT) | \ - (((token) & SCMI_MSG_TOKEN_MASK) << SCMI_MSG_TOKEN_SHIFT)) +#define SCMI_MSG_CREATE(_protocol, _msg_id, _token) \ + ((((_protocol) & SCMI_MSG_PROTO_ID_MASK) << SCMI_MSG_PROTO_ID_SHIFT) | \ + (((_msg_id) & SCMI_MSG_ID_MASK) << SCMI_MSG_ID_SHIFT) | \ + (((_token) & SCMI_MSG_TOKEN_MASK) << SCMI_MSG_TOKEN_SHIFT)) /* Helper macro to get the token from a SCMI message header */ -#define SCMI_MSG_GET_TOKEN(msg) \ - (((msg) >> SCMI_MSG_TOKEN_SHIFT) & SCMI_MSG_TOKEN_MASK) +#define SCMI_MSG_GET_TOKEN(_msg) \ + (((_msg) >> SCMI_MSG_TOKEN_SHIFT) & SCMI_MSG_TOKEN_MASK) /* SCMI Channel Status bit fields */ #define SCMI_CH_STATUS_RES0_MASK 0xFFFFFFFE diff --git a/plat/arm/css/drivers/scp/css_pm_scmi.c b/plat/arm/css/drivers/scp/css_pm_scmi.c index c0ed4874984d81c2f146a33a9f58d5ae6b46ec96..e484c601136aca254f2af4058264ccecfc3e66a4 100644 --- a/plat/arm/css/drivers/scp/css_pm_scmi.c +++ b/plat/arm/css/drivers/scp/css_pm_scmi.c @@ -36,21 +36,21 @@ #define SCMI_PWR_STATE_MAX_PWR_LVL_WIDTH 4 #define SCMI_PWR_STATE_MAX_PWR_LVL_MASK \ ((1 << SCMI_PWR_STATE_MAX_PWR_LVL_WIDTH) - 1) -#define SCMI_SET_PWR_STATE_MAX_PWR_LVL(pwr_state, max_lvl) \ - (pwr_state) |= ((max_lvl) & SCMI_PWR_STATE_MAX_PWR_LVL_MASK) \ +#define SCMI_SET_PWR_STATE_MAX_PWR_LVL(_power_state, _max_level) \ + (_power_state) |= ((_max_level) & SCMI_PWR_STATE_MAX_PWR_LVL_MASK)\ << SCMI_PWR_STATE_MAX_PWR_LVL_SHIFT -#define SCMI_GET_PWR_STATE_MAX_PWR_LVL(pwr_state) \ - (((pwr_state) >> SCMI_PWR_STATE_MAX_PWR_LVL_SHIFT) \ +#define SCMI_GET_PWR_STATE_MAX_PWR_LVL(_power_state) \ + (((_power_state) >> SCMI_PWR_STATE_MAX_PWR_LVL_SHIFT) \ & SCMI_PWR_STATE_MAX_PWR_LVL_MASK) #define SCMI_PWR_STATE_LVL_WIDTH 4 #define SCMI_PWR_STATE_LVL_MASK \ ((1 << SCMI_PWR_STATE_LVL_WIDTH) - 1) -#define SCMI_SET_PWR_STATE_LVL(pwr_state, lvl, lvl_state) \ - (pwr_state) |= ((lvl_state) & SCMI_PWR_STATE_LVL_MASK) \ - << (SCMI_PWR_STATE_LVL_WIDTH * (lvl)) -#define SCMI_GET_PWR_STATE_LVL(pwr_state, lvl) \ - (((pwr_state) >> (SCMI_PWR_STATE_LVL_WIDTH * (lvl))) & \ +#define SCMI_SET_PWR_STATE_LVL(_power_state, _level, _level_state) \ + (_power_state) |= ((_level_state) & SCMI_PWR_STATE_LVL_MASK) \ + << (SCMI_PWR_STATE_LVL_WIDTH * (_level)) +#define SCMI_GET_PWR_STATE_LVL(_power_state, _level) \ + (((_power_state) >> (SCMI_PWR_STATE_LVL_WIDTH * (_level))) & \ SCMI_PWR_STATE_LVL_MASK) /* diff --git a/plat/arm/css/drivers/sds/sds_private.h b/plat/arm/css/drivers/sds/sds_private.h index 649576b6d15c4787cf69c9f958cc24c886f0a6d1..43b97f68100d5c2243d73babd127cbcbbe0b4e45 100644 --- a/plat/arm/css/drivers/sds/sds_private.h +++ b/plat/arm/css/drivers/sds/sds_private.h @@ -67,18 +67,18 @@ typedef struct structure_header { uint32_t reg[2]; } struct_header_t; -#define GET_SDS_HEADER_ID(header) \ - ((((struct_header_t *)(header))->reg[0]) & SDS_HEADER_ID_MASK) -#define GET_SDS_HEADER_VERSION(header) \ - (((((struct_header_t *)(header))->reg[0]) >> SDS_HEADER_MINOR_VERSION_SHIFT)\ +#define GET_SDS_HEADER_ID(_header) \ + ((((struct_header_t *)(_header))->reg[0]) & SDS_HEADER_ID_MASK) +#define GET_SDS_HEADER_VERSION(_header) \ + (((((struct_header_t *)(_header))->reg[0]) >> SDS_HEADER_MINOR_VERSION_SHIFT)\ & SDS_HEADER_VERSION_MASK) -#define GET_SDS_HEADER_STRUCT_SIZE(header) \ - (((((struct_header_t *)(header))->reg[1]) >> SDS_HEADER_STRUCT_SIZE_SHIFT)\ +#define GET_SDS_HEADER_STRUCT_SIZE(_header) \ + (((((struct_header_t *)(_header))->reg[1]) >> SDS_HEADER_STRUCT_SIZE_SHIFT)\ & SDS_HEADER_STRUCT_SIZE_MASK) -#define IS_SDS_HEADER_VALID(header) \ - ((((struct_header_t *)(header))->reg[1]) & SDS_HEADER_VALID_MASK) -#define GET_SDS_STRUCT_FIELD(header, field_offset) \ - ((((uint8_t *)(header)) + sizeof(struct_header_t)) + (field_offset)) +#define IS_SDS_HEADER_VALID(_header) \ + ((((struct_header_t *)(_header))->reg[1]) & SDS_HEADER_VALID_MASK) +#define GET_SDS_STRUCT_FIELD(_header, _field_offset) \ + ((((uint8_t *)(_header)) + sizeof(struct_header_t)) + (_field_offset)) /* Region Descriptor describing the SDS Memory Region */ typedef struct region_descriptor {