diff options
author | Srirangan <smadhavan@nvidia.com> | 2018-08-01 03:32:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-02 16:56:31 -0400 |
commit | 63e6e8ee3ee9ce01b1f7d4c0014bb589df105d71 (patch) | |
tree | f4db057c93973a9ad4afa15d1c6e5e1f2440c241 /drivers/gpu/nvgpu/common/pmu | |
parent | e6c135ecb70e8b966fc036587301c979ae70e869 (diff) |
gpu: nvgpu: common: Fix MISRA 15.6 violations
This fixes errors due to single statement loop bodies
without braces, which is part of Rule 15.6 of MISRA.
This patch covers in gpu/nvgpu/common/
JIRA NVGPU-989
Change-Id: Ic6a98a1cd04e4524dabf650e2f6e73c6b5a1db9d
Signed-off-by: Srirangan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1786207
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
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')
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu_fw.c | 9 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu_ipc.c | 3 |
3 files changed, 13 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu.c b/drivers/gpu/nvgpu/common/pmu/pmu.c index 327f67d3..2dcadb48 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -358,8 +358,9 @@ int nvgpu_pmu_process_init_msg(struct nvgpu_pmu *pmu, | |||
358 | } | 358 | } |
359 | } | 359 | } |
360 | 360 | ||
361 | for (i = 0; i < PMU_QUEUE_COUNT; i++) | 361 | for (i = 0; i < PMU_QUEUE_COUNT; i++) { |
362 | nvgpu_pmu_queue_init(pmu, i, init); | 362 | nvgpu_pmu_queue_init(pmu, i, init); |
363 | } | ||
363 | 364 | ||
364 | if (!nvgpu_alloc_initialized(&pmu->dmem)) { | 365 | if (!nvgpu_alloc_initialized(&pmu->dmem)) { |
365 | /* Align start and end addresses */ | 366 | /* Align start and end addresses */ |
@@ -480,8 +481,9 @@ static int nvgpu_pg_init_task(void *arg) | |||
480 | 481 | ||
481 | } | 482 | } |
482 | 483 | ||
483 | while (!nvgpu_thread_should_stop(&pg_init->state_task)) | 484 | while (!nvgpu_thread_should_stop(&pg_init->state_task)) { |
484 | nvgpu_usleep_range(5000, 5100); | 485 | nvgpu_usleep_range(5000, 5100); |
486 | } | ||
485 | 487 | ||
486 | nvgpu_log_fn(g, "thread exit"); | 488 | nvgpu_log_fn(g, "thread exit"); |
487 | 489 | ||
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c index 53eae49a..fc328401 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c | |||
@@ -881,8 +881,9 @@ static void get_pmu_init_msg_pmu_queue_params_v4( | |||
881 | queue->index = init->queue_index[tmp_id]; | 881 | queue->index = init->queue_index[tmp_id]; |
882 | queue->size = init->queue_size[tmp_id]; | 882 | queue->size = init->queue_size[tmp_id]; |
883 | if (tmp_id != 0) { | 883 | if (tmp_id != 0) { |
884 | for (i = 0 ; i < tmp_id; i++) | 884 | for (i = 0 ; i < tmp_id; i++) { |
885 | current_ptr += init->queue_size[i]; | 885 | current_ptr += init->queue_size[i]; |
886 | } | ||
886 | } | 887 | } |
887 | queue->offset = init->queue_offset + current_ptr; | 888 | queue->offset = init->queue_offset + current_ptr; |
888 | } | 889 | } |
@@ -908,8 +909,9 @@ static void get_pmu_init_msg_pmu_queue_params_v5( | |||
908 | queue->index = init->queue_index[tmp_id]; | 909 | queue->index = init->queue_index[tmp_id]; |
909 | queue->size = init->queue_size[tmp_id]; | 910 | queue->size = init->queue_size[tmp_id]; |
910 | if (tmp_id != 0) { | 911 | if (tmp_id != 0) { |
911 | for (i = 0 ; i < tmp_id; i++) | 912 | for (i = 0 ; i < tmp_id; i++) { |
912 | current_ptr += init->queue_size[i]; | 913 | current_ptr += init->queue_size[i]; |
914 | } | ||
913 | } | 915 | } |
914 | queue->offset = init->queue_offset + current_ptr; | 916 | queue->offset = init->queue_offset + current_ptr; |
915 | } | 917 | } |
@@ -935,8 +937,9 @@ static void get_pmu_init_msg_pmu_queue_params_v3( | |||
935 | queue->index = init->queue_index[tmp_id]; | 937 | queue->index = init->queue_index[tmp_id]; |
936 | queue->size = init->queue_size[tmp_id]; | 938 | queue->size = init->queue_size[tmp_id]; |
937 | if (tmp_id != 0) { | 939 | if (tmp_id != 0) { |
938 | for (i = 0 ; i < tmp_id; i++) | 940 | for (i = 0 ; i < tmp_id; i++) { |
939 | current_ptr += init->queue_size[i]; | 941 | current_ptr += init->queue_size[i]; |
942 | } | ||
940 | } | 943 | } |
941 | queue->offset = init->queue_offset + current_ptr; | 944 | queue->offset = init->queue_offset + current_ptr; |
942 | } | 945 | } |
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c b/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c index f34e942d..cb7c10a3 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c | |||
@@ -39,8 +39,9 @@ void nvgpu_pmu_seq_init(struct nvgpu_pmu *pmu) | |||
39 | memset(pmu->pmu_seq_tbl, 0, | 39 | memset(pmu->pmu_seq_tbl, 0, |
40 | sizeof(pmu->pmu_seq_tbl)); | 40 | sizeof(pmu->pmu_seq_tbl)); |
41 | 41 | ||
42 | for (i = 0; i < PMU_MAX_NUM_SEQUENCES; i++) | 42 | for (i = 0; i < PMU_MAX_NUM_SEQUENCES; i++) { |
43 | pmu->seq[i].id = i; | 43 | pmu->seq[i].id = i; |
44 | } | ||
44 | } | 45 | } |
45 | 46 | ||
46 | static int pmu_seq_acquire(struct nvgpu_pmu *pmu, | 47 | static int pmu_seq_acquire(struct nvgpu_pmu *pmu, |