From 50f5f6ff686e3615722d88528f32c377be76e548 Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Wed, 23 Oct 2019 06:07:16 -0700 Subject: [PATCH] gpu: nvgpu: fix MISRA 7.4 in posix/os_sched.c MISRA Rule 7.4 doesn't allow string literal to initialize char * object. This patch modifies log_message definition to resolve MISRA errors. Jira NVGPU-4075 Change-Id: Iea1c08e76b5af691ff98c24657d6295d17a5b757 Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/2224232 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/posix/os_sched.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/os/posix/os_sched.c b/drivers/gpu/nvgpu/os/posix/os_sched.c index 197f9c642..692216b05 100644 --- a/drivers/gpu/nvgpu/os/posix/os_sched.c +++ b/drivers/gpu/nvgpu/os/posix/os_sched.c @@ -42,7 +42,7 @@ int nvgpu_current_tid(struct gk20a *g) void nvgpu_print_current_impl(struct gk20a *g, const char *func_name, int line, void *ctx, enum nvgpu_log_type type) { - char *log_message = "(unknown process)"; + const char *log_message = "(unknown process)"; #if defined(__NVGPU_POSIX__) #ifdef _GNU_SOURCE @@ -53,8 +53,7 @@ void nvgpu_print_current_impl(struct gk20a *g, const char *func_name, int line, log_message = current_tname; } #else - nvgpu_err(g, "(unknown process)"); - return; + type = NVGPU_ERROR; #endif #else char current_tname[CURRENT_NAME_LEN];