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 <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2224232
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2019-10-23 06:07:16 -07:00
committed by Alex Waterman
parent caf2b991cd
commit 50f5f6ff68

View File

@@ -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];