summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pmgr/pmgrpmu.c
diff options
context:
space:
mode:
authorSai Nikhil <snikhil@nvidia.com>2018-09-11 01:08:54 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-27 02:35:37 -0400
commitc6cfb12d91accc759ed80985573014df89d9cdaa (patch)
tree0bc9f467e0f52732a9d5916cb804b12b8f00134b /drivers/gpu/nvgpu/pmgr/pmgrpmu.c
parentc18c8b5b28b839ac20ae2c4b1003e9b44199016a (diff)
gpu: nvgpu: pmgr: fix MISRA Rule 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 fixes violation where an arithmetic operation is performed on signed and unsigned int types. JIRA NVGPU-992 Change-Id: Id3b2c8ea1af1807087468c6978abfbfc85bee2ec Signed-off-by: Sai Nikhil <snikhil@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1809757 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Adeel Raza <araza@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr/pmgrpmu.c')
-rw-r--r--drivers/gpu/nvgpu/pmgr/pmgrpmu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c
index 411550be..b6947f20 100644
--- a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c
+++ b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c
@@ -52,7 +52,7 @@ static void pmgr_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
52 52
53 if (msg->msg.pmgr.msg_type == NV_PMU_PMGR_MSG_ID_SET_OBJECT) { 53 if (msg->msg.pmgr.msg_type == NV_PMU_PMGR_MSG_ID_SET_OBJECT) {
54 if ((msg->msg.pmgr.set_object.b_success != 1) || 54 if ((msg->msg.pmgr.set_object.b_success != 1) ||
55 (msg->msg.pmgr.set_object.flcnstatus != 0) ) { 55 (msg->msg.pmgr.set_object.flcnstatus != 0U)) {
56 nvgpu_err(g, "pmgr msg failed %x %x %x %x", 56 nvgpu_err(g, "pmgr msg failed %x %x %x %x",
57 msg->msg.pmgr.set_object.msg_type, 57 msg->msg.pmgr.set_object.msg_type,
58 msg->msg.pmgr.set_object.b_success, 58 msg->msg.pmgr.set_object.b_success,
@@ -62,7 +62,7 @@ static void pmgr_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
62 } 62 }
63 } else if (msg->msg.pmgr.msg_type == NV_PMU_PMGR_MSG_ID_QUERY) { 63 } else if (msg->msg.pmgr.msg_type == NV_PMU_PMGR_MSG_ID_QUERY) {
64 if ((msg->msg.pmgr.query.b_success != 1) || 64 if ((msg->msg.pmgr.query.b_success != 1) ||
65 (msg->msg.pmgr.query.flcnstatus != 0) ) { 65 (msg->msg.pmgr.query.flcnstatus != 0U)) {
66 nvgpu_err(g, "pmgr msg failed %x %x %x %x", 66 nvgpu_err(g, "pmgr msg failed %x %x %x %x",
67 msg->msg.pmgr.query.msg_type, 67 msg->msg.pmgr.query.msg_type,
68 msg->msg.pmgr.query.b_success, 68 msg->msg.pmgr.query.b_success,
@@ -72,7 +72,7 @@ static void pmgr_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
72 } 72 }
73 } else if (msg->msg.pmgr.msg_type == NV_PMU_PMGR_MSG_ID_LOAD) { 73 } else if (msg->msg.pmgr.msg_type == NV_PMU_PMGR_MSG_ID_LOAD) {
74 if ((msg->msg.pmgr.query.b_success != 1) || 74 if ((msg->msg.pmgr.query.b_success != 1) ||
75 (msg->msg.pmgr.query.flcnstatus != 0) ) { 75 (msg->msg.pmgr.query.flcnstatus != 0U)) {
76 nvgpu_err(g, "pmgr msg failed %x %x %x", 76 nvgpu_err(g, "pmgr msg failed %x %x %x",
77 msg->msg.pmgr.load.msg_type, 77 msg->msg.pmgr.load.msg_type,
78 msg->msg.pmgr.load.b_success, 78 msg->msg.pmgr.load.b_success,
@@ -133,7 +133,7 @@ static u32 pmgr_pmu_set_object(struct gk20a *g,
133 gk20a_get_gr_idle_timeout(g), 133 gk20a_get_gr_idle_timeout(g),
134 &handlerparams.success, 1); 134 &handlerparams.success, 1);
135 135
136 if (handlerparams.success == 0) { 136 if (handlerparams.success == 0U) {
137 nvgpu_err(g, "could not process cmd"); 137 nvgpu_err(g, "could not process cmd");
138 status = -ETIMEDOUT; 138 status = -ETIMEDOUT;
139 goto exit; 139 goto exit;
@@ -431,7 +431,7 @@ u32 pmgr_pmu_pwr_devices_query_blocking(
431 gk20a_get_gr_idle_timeout(g), 431 gk20a_get_gr_idle_timeout(g),
432 &handlerparams.success, 1); 432 &handlerparams.success, 1);
433 433
434 if (handlerparams.success == 0) { 434 if (handlerparams.success == 0U) {
435 nvgpu_err(g, "could not process cmd"); 435 nvgpu_err(g, "could not process cmd");
436 status = -ETIMEDOUT; 436 status = -ETIMEDOUT;
437 goto exit; 437 goto exit;
@@ -475,7 +475,7 @@ static u32 pmgr_pmu_load_blocking(struct gk20a *g)
475 gk20a_get_gr_idle_timeout(g), 475 gk20a_get_gr_idle_timeout(g),
476 &handlerparams.success, 1); 476 &handlerparams.success, 1);
477 477
478 if (handlerparams.success == 0) { 478 if (handlerparams.success == 0U) {
479 nvgpu_err(g, "could not process cmd"); 479 nvgpu_err(g, "could not process cmd");
480 status = -ETIMEDOUT; 480 status = -ETIMEDOUT;
481 goto exit; 481 goto exit;