aboutsummaryrefslogtreecommitdiff
path: root/plat/nvidia/tegra/common/tegra_platform.c
diff options
context:
space:
mode:
authorAnthony Zhou <anzhou@nvidia.com>2017-07-07 14:29:51 +0800
committerVarun Wadekar <vwadekar@nvidia.com>2019-01-18 09:21:50 -0800
commit4c9940022801725ad6871078650be09ca01ca0d5 (patch)
treedd53ffc449fe05efe463dcb7fe0e59e9419d8d3e /plat/nvidia/tegra/common/tegra_platform.c
parent75516c3eb021e91e37e4d3115a0bbab143ddd2ff (diff)
downloadtrusted-firmware-a-4c9940022801725ad6871078650be09ca01ca0d5.tar.gz
Tegra: common: fix defects flagged by MISRA scan
Macro assert(e) request 'e' is a bool type, if useing other type, MISRA report a "The Essential Type Model" violation, Add a judgement to fix the defects, if 'e' is not bool type. Remove unused code [Rule 2.5] Fix the essential type model violation [Rule 10.6, 10.7] Use local parameter to raplace function parameter [Rule 17.8] Change-Id: Ifce932addbb0a4b063ef6b38349d886c051d81c0 Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
Diffstat (limited to 'plat/nvidia/tegra/common/tegra_platform.c')
-rw-r--r--plat/nvidia/tegra/common/tegra_platform.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plat/nvidia/tegra/common/tegra_platform.c b/plat/nvidia/tegra/common/tegra_platform.c
index 72da12663e..c1e4209593 100644
--- a/plat/nvidia/tegra/common/tegra_platform.c
+++ b/plat/nvidia/tegra/common/tegra_platform.c
@@ -15,7 +15,7 @@
* Tegra platforms
******************************************************************************/
typedef enum tegra_platform {
- TEGRA_PLATFORM_SILICON = 0,
+ TEGRA_PLATFORM_SILICON = 0U,
TEGRA_PLATFORM_QT,
TEGRA_PLATFORM_FPGA,
TEGRA_PLATFORM_EMULATION,
@@ -83,7 +83,7 @@ bool tegra_chipid_is_t132(void)
{
uint32_t chip_id = ((tegra_get_chipid() >> CHIP_ID_SHIFT) & CHIP_ID_MASK);
- return (chip_id == (uint32_t)TEGRA_CHIPID_TEGRA13);
+ return (chip_id == TEGRA_CHIPID_TEGRA13);
}
bool tegra_chipid_is_t186(void)
@@ -97,12 +97,12 @@ bool tegra_chipid_is_t210(void)
{
uint32_t chip_id = (tegra_get_chipid() >> CHIP_ID_SHIFT) & CHIP_ID_MASK;
- return (chip_id == (uint32_t)TEGRA_CHIPID_TEGRA21);
+ return (chip_id == TEGRA_CHIPID_TEGRA21);
}
bool tegra_chipid_is_t210_b01(void)
{
- return (tegra_chipid_is_t210() && (tegra_get_chipid_major() == 0x2UL));
+ return (tegra_chipid_is_t210() && (tegra_get_chipid_major() == 0x2U));
}
/*