gpu: nvgpu: fix sim STR30 CERT C violations

Make path a pointer to const char to avoid attempt to
modify string literal.

Error: CERT STR30-C:
drivers/gpu/nvgpu/common/sim/sim_netlist.c:363:
cert_violation: Assigning or casting string literal
 ""GRCTX_GEN_CTX_REGS_BASE_INDEX"" to a pointer to non-const.

Jira NVGPU-3560

Change-Id: I22dacbbd210a43c41aef2532c5ddb1429d5c9153
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2122101
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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:
Nitin Kumbhar
2019-05-20 16:31:11 +05:30
committed by mobile promotions
parent 16a3929680
commit e0061b8daa
3 changed files with 3 additions and 3 deletions

View File

@@ -219,7 +219,7 @@ static int issue_rpc_and_wait(struct gk20a *g)
}
static void nvgpu_sim_esc_readl(struct gk20a *g,
char *path, u32 index, u32 *data)
const char *path, u32 index, u32 *data)
{
int err;
size_t pathlen = strlen(path);

View File

@@ -185,7 +185,7 @@ static int issue_rpc_and_wait(struct gk20a *g)
}
static void nvgpu_sim_esc_readl(struct gk20a *g,
char *path, u32 index, u32 *data)
const char *path, u32 index, u32 *data)
{
int err;
size_t pathlen = strlen(path);

View File

@@ -37,7 +37,7 @@ struct sim_nvgpu {
void (*sim_init_late)(struct gk20a *g);
void (*remove_support)(struct gk20a *g);
void (*esc_readl)(
struct gk20a *g, char *path, u32 index, u32 *data);
struct gk20a *g, const char *path, u32 index, u32 *data);
};
#ifdef __KERNEL__
#include "linux/sim.h"