summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mc_gk20a.c
diff options
context:
space:
mode:
authorScott Long <scottl@nvidia.com>2018-08-08 21:30:09 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-22 20:31:42 -0400
commit07f6739285140d7c5335ddcb8996450966bfc175 (patch)
treec7f1b3a73d519e44e4fe0d29516e6516740edb26 /drivers/gpu/nvgpu/gk20a/mc_gk20a.c
parent1c13da1d29c344cb60953eabeca56b601446c64a (diff)
gpu: nvgpu: switch gk20a nonstall ops to #defines
Fix MISRA rule 10.1 violations involving gk20a_nonstall_ops enums by replacing them with with corresponding #defines. Because these values can be used in expressions that require unsigned values (e.g. bitwise OR) we cannot use enums. The g->ce2.isr_nonstall() function was previously returning an int that was a combination of gk20a_nonstall_ops enum bits which led to the violations. JIRA NVGPU-650 Change-Id: I6210aacec8829b3c8d339c5fe3db2f3069c67406 Signed-off-by: Scott Long <scottl@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1796242 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mc_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mc_gk20a.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c
index 26084bd6..a0eae127 100644
--- a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c
@@ -319,9 +319,10 @@ void mc_gk20a_handle_intr_nonstall(struct gk20a *g, u32 ops)
319{ 319{
320 bool semaphore_wakeup, post_events; 320 bool semaphore_wakeup, post_events;
321 321
322 semaphore_wakeup = (((ops & (u32)gk20a_nonstall_ops_wakeup_semaphore) != 0U) ? 322 semaphore_wakeup =
323 (((ops & GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE) != 0U) ?
323 true : false); 324 true : false);
324 post_events = (((ops & (u32)gk20a_nonstall_ops_post_events) != 0U) ? 325 post_events = (((ops & GK20A_NONSTALL_OPS_POST_EVENTS) != 0U) ?
325 true: false); 326 true: false);
326 327
327 if (semaphore_wakeup) { 328 if (semaphore_wakeup) {