summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/pmu/pmu_fw.c
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/common/pmu/pmu_fw.c
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/common/pmu/pmu_fw.c')
-rw-r--r--drivers/gpu/nvgpu/common/pmu/pmu_fw.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c
index 87fd2f2a..bf54e0d6 100644
--- a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c
+++ b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c
@@ -37,12 +37,12 @@
37#define NVGPU_PMU_NS_UCODE_IMAGE "gpmu_ucode.bin" 37#define NVGPU_PMU_NS_UCODE_IMAGE "gpmu_ucode.bin"
38 38
39/* PMU F/W version */ 39/* PMU F/W version */
40#define APP_VERSION_GPU_NEXT 24313845 40#define APP_VERSION_GPU_NEXT 24313845U
41#define APP_VERSION_GV11B 24379482 41#define APP_VERSION_GV11B 24379482U
42#define APP_VERSION_GV10X 23647491 42#define APP_VERSION_GV10X 23647491U
43#define APP_VERSION_GP10X 24076634 43#define APP_VERSION_GP10X 24076634U
44#define APP_VERSION_GP10B 23782727 44#define APP_VERSION_GP10B 23782727U
45#define APP_VERSION_GM20B 20490253 45#define APP_VERSION_GM20B 20490253U
46 46
47/* PMU version specific functions */ 47/* PMU version specific functions */
48static u32 pmu_perfmon_cntr_sz_v2(struct nvgpu_pmu *pmu) 48static u32 pmu_perfmon_cntr_sz_v2(struct nvgpu_pmu *pmu)
@@ -82,7 +82,7 @@ static void set_perfmon_cntr_group_id_v2(struct nvgpu_pmu *pmu, u8 gid)
82 82
83static void set_pmu_cmdline_args_falctracedmabase_v4(struct nvgpu_pmu *pmu) 83static void set_pmu_cmdline_args_falctracedmabase_v4(struct nvgpu_pmu *pmu)
84{ 84{
85 pmu->args_v4.dma_addr.dma_base = ((u32)pmu->trace_buf.gpu_va)/0x100; 85 pmu->args_v4.dma_addr.dma_base = ((u32)pmu->trace_buf.gpu_va)/0x100U;
86 pmu->args_v4.dma_addr.dma_base1 = 0; 86 pmu->args_v4.dma_addr.dma_base1 = 0;
87 pmu->args_v4.dma_addr.dma_offset = 0; 87 pmu->args_v4.dma_addr.dma_offset = 0;
88} 88}
@@ -182,7 +182,7 @@ static void set_pmu_cmdline_args_falctracesize_v3(
182 182
183static void set_pmu_cmdline_args_falctracedmabase_v3(struct nvgpu_pmu *pmu) 183static void set_pmu_cmdline_args_falctracedmabase_v3(struct nvgpu_pmu *pmu)
184{ 184{
185 pmu->args_v3.falc_trace_dma_base = ((u32)pmu->trace_buf.gpu_va)/0x100; 185 pmu->args_v3.falc_trace_dma_base = ((u32)pmu->trace_buf.gpu_va)/0x100U;
186} 186}
187 187
188static void set_pmu_cmdline_args_falctracedmaidx_v3( 188static void set_pmu_cmdline_args_falctracedmaidx_v3(
@@ -882,7 +882,7 @@ static void get_pmu_init_msg_pmu_queue_params_v4(
882 882
883 queue->index = init->queue_index[tmp_id]; 883 queue->index = init->queue_index[tmp_id];
884 queue->size = init->queue_size[tmp_id]; 884 queue->size = init->queue_size[tmp_id];
885 if (tmp_id != 0) { 885 if (tmp_id != 0U) {
886 for (i = 0 ; i < tmp_id; i++) { 886 for (i = 0 ; i < tmp_id; i++) {
887 current_ptr += init->queue_size[i]; 887 current_ptr += init->queue_size[i];
888 } 888 }
@@ -911,7 +911,7 @@ static void get_pmu_init_msg_pmu_queue_params_v5(
911 911
912 queue->index = init->queue_index[tmp_id]; 912 queue->index = init->queue_index[tmp_id];
913 queue->size = init->queue_size[tmp_id]; 913 queue->size = init->queue_size[tmp_id];
914 if (tmp_id != 0) { 914 if (tmp_id != 0U) {
915 for (i = 0 ; i < tmp_id; i++) { 915 for (i = 0 ; i < tmp_id; i++) {
916 current_ptr += init->queue_size[i]; 916 current_ptr += init->queue_size[i];
917 } 917 }
@@ -940,7 +940,7 @@ static void get_pmu_init_msg_pmu_queue_params_v3(
940 } 940 }
941 queue->index = init->queue_index[tmp_id]; 941 queue->index = init->queue_index[tmp_id];
942 queue->size = init->queue_size[tmp_id]; 942 queue->size = init->queue_size[tmp_id];
943 if (tmp_id != 0) { 943 if (tmp_id != 0U) {
944 for (i = 0 ; i < tmp_id; i++) { 944 for (i = 0 ; i < tmp_id; i++) {
945 current_ptr += init->queue_size[i]; 945 current_ptr += init->queue_size[i];
946 } 946 }