From a138f7687159685175ee8f249dbe7ea1c22e90e1 Mon Sep 17 00:00:00 2001 From: Daniel Boulby Date: Mon, 14 May 2018 17:18:58 +0100 Subject: [PATCH] Fix MISRA Rule 5.7 Part 2 Follow convention of shorter names for smaller scope to fix violations of MISRA rule 5.7 To prevent violation of directive 4.5 having variable name channel in css_pm_scmi.c not being typographically ambiguous change macro argument CHANNEL in css_mhu_doorbell.h change argument to _channel to fit with our convention which is a permitted exception of directive 4.5 for this project Rule 5.7: A tag name shall be a unique identifier Fixed for: make LOG_LEVEL=50 PLAT=juno Change-Id: I147cdb13553e83ed7df19149b282706db115d612 Signed-off-by: Daniel Boulby --- plat/arm/css/drivers/mhu/css_mhu_doorbell.h | 4 ++-- plat/arm/css/drivers/scp/css_pm_scmi.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plat/arm/css/drivers/mhu/css_mhu_doorbell.h b/plat/arm/css/drivers/mhu/css_mhu_doorbell.h index 3c94536881..cb75ed050a 100644 --- a/plat/arm/css/drivers/mhu/css_mhu_doorbell.h +++ b/plat/arm/css/drivers/mhu/css_mhu_doorbell.h @@ -18,8 +18,8 @@ #define MHU_V2_ACCESS_REQ_OFFSET 0xF88 #define MHU_V2_ACCESS_READY_OFFSET 0xF8C -#define SENDER_REG_STAT(CHANNEL) (0x20 * (CHANNEL)) -#define SENDER_REG_SET(CHANNEL) (0x20 * (CHANNEL)) + 0xC +#define SENDER_REG_STAT(_channel) (0x20 * (_channel)) +#define SENDER_REG_SET(_channel) ((0x20 * (_channel)) + 0xC) /* Helper macro to ring doorbell */ #define MHU_RING_DOORBELL(addr, modify_mask, preserve_mask) do { \ diff --git a/plat/arm/css/drivers/scp/css_pm_scmi.c b/plat/arm/css/drivers/scp/css_pm_scmi.c index e484c60113..3a255096e8 100644 --- a/plat/arm/css/drivers/scp/css_pm_scmi.c +++ b/plat/arm/css/drivers/scp/css_pm_scmi.c @@ -69,7 +69,7 @@ typedef enum { static void *scmi_handle; /* The SCMI channel global object */ -static scmi_channel_t scmi_channel; +static scmi_channel_t channel; ARM_INSTANTIATE_LOCK; @@ -308,9 +308,9 @@ scmi_channel_plat_info_t plat_css_scmi_plat_info = { void plat_arm_pwrc_setup(void) { - scmi_channel.info = &plat_css_scmi_plat_info; - scmi_channel.lock = ARM_LOCK_GET_INSTANCE; - scmi_handle = scmi_init(&scmi_channel); + channel.info = &plat_css_scmi_plat_info; + channel.lock = ARM_LOCK_GET_INSTANCE; + scmi_handle = scmi_init(&channel); if (scmi_handle == NULL) { ERROR("SCMI Initialization failed\n"); panic();