From b2a10e5452c39e06dd360815b1471ff9a82f2fb2 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 3 May 2019 19:17:31 +0530 Subject: [PATCH] gpu: nvgpu: fix MISRA 16.4 violation in gr.obj_ctx unit Below MISRA 16.4 violations are reported in gr.obj_ctx unit nvgpu/drivers/gpu/nvgpu/common/gr/obj_ctx.c:135: misra_violation: The switch statement "switch (graphics_preempt_mode)" does not have a non-empty default clause. nvgpu/drivers/gpu/nvgpu/common/gr/obj_ctx.c:188: misra_violation: The switch statement "switch (compute_preempt_mode)" does not have a non-empty default clause. Fix them by adding a debug print in default case Jira NVGPU-3407 Change-Id: I0beabd020885f574f798a852008b5ccac919b450 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/2114366 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/gr/obj_ctx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/nvgpu/common/gr/obj_ctx.c b/drivers/gpu/nvgpu/common/gr/obj_ctx.c index 70653fde0..850b02f8e 100644 --- a/drivers/gpu/nvgpu/common/gr/obj_ctx.c +++ b/drivers/gpu/nvgpu/common/gr/obj_ctx.c @@ -180,6 +180,8 @@ int nvgpu_gr_obj_ctx_set_ctxsw_preemption_mode(struct gk20a *g, break; default: + nvgpu_log_info(g, "graphics_preempt_mode=%u", + graphics_preempt_mode); break; } @@ -193,6 +195,8 @@ int nvgpu_gr_obj_ctx_set_ctxsw_preemption_mode(struct gk20a *g, compute_preempt_mode); break; default: + nvgpu_log_info(g, "compute_preempt_mode=%u", + compute_preempt_mode); break; } }