summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include/nvgpu/pmu.h
diff options
context:
space:
mode:
authorSai Nikhil <snikhil@nvidia.com>2018-08-22 01:12:37 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-22 20:30:19 -0400
commitd28a401e6d872f7ea6abb0c5cfc8f63e0235fe21 (patch)
tree66b5c4ad42135dbd9f5535fa3c86f8ecdd1a067c /drivers/gpu/nvgpu/include/nvgpu/pmu.h
parent650171566bff59e9eb372f213fdce4dfbb6da5bd (diff)
gpu: nvgpu: common: fix MISRA 10.4 violations
MISRA Rule 10.4 only allows the usage of arithmetic operations on operands of the same essential type category. Adding "U" at the end of the integer literals to have same type of operands when an arithmetic operation is performed. This fix violations where an arithmetic operation is performed on signed and unsigned int types. Jira NVGPU-992 Change-Id: Iab512139a025e035ec82a9dd74245bcf1f3869fb Signed-off-by: Sai Nikhil <snikhil@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1789425 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Adeel Raza <araza@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu/pmu.h')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmu.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu.h b/drivers/gpu/nvgpu/include/nvgpu/pmu.h
index 28374b9d..1240530f 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/pmu.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmu.h
@@ -84,21 +84,21 @@
84#define PMU_FALCON_REG_SIZE (32) 84#define PMU_FALCON_REG_SIZE (32)
85 85
86/* Choices for pmu_state */ 86/* Choices for pmu_state */
87#define PMU_STATE_OFF 0 /* PMU is off */ 87#define PMU_STATE_OFF 0U /* PMU is off */
88#define PMU_STATE_STARTING 1 /* PMU is on, but not booted */ 88#define PMU_STATE_STARTING 1U /* PMU is on, but not booted */
89#define PMU_STATE_INIT_RECEIVED 2 /* PMU init message received */ 89#define PMU_STATE_INIT_RECEIVED 2U /* PMU init message received */
90#define PMU_STATE_ELPG_BOOTING 3 /* PMU is booting */ 90#define PMU_STATE_ELPG_BOOTING 3U /* PMU is booting */
91#define PMU_STATE_ELPG_BOOTED 4 /* ELPG is initialized */ 91#define PMU_STATE_ELPG_BOOTED 4U /* ELPG is initialized */
92#define PMU_STATE_LOADING_PG_BUF 5 /* Loading PG buf */ 92#define PMU_STATE_LOADING_PG_BUF 5U /* Loading PG buf */
93#define PMU_STATE_LOADING_ZBC 6 /* Loading ZBC buf */ 93#define PMU_STATE_LOADING_ZBC 6U /* Loading ZBC buf */
94#define PMU_STATE_STARTED 7 /* Fully unitialized */ 94#define PMU_STATE_STARTED 7U /* Fully unitialized */
95#define PMU_STATE_EXIT 8 /* Exit PMU state machine */ 95#define PMU_STATE_EXIT 8U /* Exit PMU state machine */
96 96
97#define GK20A_PMU_UCODE_NB_MAX_OVERLAY 32 97#define GK20A_PMU_UCODE_NB_MAX_OVERLAY 32U
98#define GK20A_PMU_UCODE_NB_MAX_DATE_LENGTH 64 98#define GK20A_PMU_UCODE_NB_MAX_DATE_LENGTH 64U
99 99
100#define PMU_MAX_NUM_SEQUENCES (256) 100#define PMU_MAX_NUM_SEQUENCES (256U)
101#define PMU_SEQ_BIT_SHIFT (5) 101#define PMU_SEQ_BIT_SHIFT (5U)
102#define PMU_SEQ_TBL_SIZE \ 102#define PMU_SEQ_TBL_SIZE \
103 (PMU_MAX_NUM_SEQUENCES >> PMU_SEQ_BIT_SHIFT) 103 (PMU_MAX_NUM_SEQUENCES >> PMU_SEQ_BIT_SHIFT)
104 104
@@ -132,8 +132,8 @@ enum {
132#define PMU_PG_LPWR_FEATURE_RPPG 0x0 132#define PMU_PG_LPWR_FEATURE_RPPG 0x0
133#define PMU_PG_LPWR_FEATURE_MSCG 0x1 133#define PMU_PG_LPWR_FEATURE_MSCG 0x1
134 134
135#define PMU_MSCG_DISABLED 0 135#define PMU_MSCG_DISABLED 0U
136#define PMU_MSCG_ENABLED 1 136#define PMU_MSCG_ENABLED 1U
137 137
138/* Default Sampling Period of AELPG */ 138/* Default Sampling Period of AELPG */
139#define APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US (1000000) 139#define APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US (1000000)
@@ -350,7 +350,7 @@ struct nvgpu_pmu {
350 u32 mscg_stat; 350 u32 mscg_stat;
351 u32 mscg_transition_state; 351 u32 mscg_transition_state;
352 352
353 int pmu_state; 353 u32 pmu_state;
354 354
355#define PMU_ELPG_ENABLE_ALLOW_DELAY_MSEC 1 /* msec */ 355#define PMU_ELPG_ENABLE_ALLOW_DELAY_MSEC 1 /* msec */
356 struct nvgpu_pg_init pg_init; 356 struct nvgpu_pg_init pg_init;