summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
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/gk20a.h
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/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 5300f7dd..cf202f14 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -207,7 +207,7 @@ struct gpu_ops {
207 } ltc; 207 } ltc;
208 struct { 208 struct {
209 void (*isr_stall)(struct gk20a *g, u32 inst_id, u32 pri_base); 209 void (*isr_stall)(struct gk20a *g, u32 inst_id, u32 pri_base);
210 int (*isr_nonstall)(struct gk20a *g, u32 inst_id, u32 pri_base); 210 u32 (*isr_nonstall)(struct gk20a *g, u32 inst_id, u32 pri_base);
211 u32 (*get_num_pce)(struct gk20a *g); 211 u32 (*get_num_pce)(struct gk20a *g);
212 } ce2; 212 } ce2;
213 struct { 213 struct {
@@ -1668,10 +1668,8 @@ struct gk20a_cyclestate_buffer_elem {
1668}; 1668};
1669 1669
1670/* operations that will need to be executed on non stall workqueue */ 1670/* operations that will need to be executed on non stall workqueue */
1671enum gk20a_nonstall_ops { 1671#define GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE BIT32(0)
1672 gk20a_nonstall_ops_wakeup_semaphore = BIT(0), /* wake up semaphore */ 1672#define GK20A_NONSTALL_OPS_POST_EVENTS BIT32(1)
1673 gk20a_nonstall_ops_post_events = BIT(1),
1674};
1675 1673
1676/* register accessors */ 1674/* register accessors */
1677void __nvgpu_check_gpu_state(struct gk20a *g); 1675void __nvgpu_check_gpu_state(struct gk20a *g);