gpu: nvgpu: replace hardcoded subscript with macro

size of syncpt_name is hardcoded. Patch replaces hardcoded value with
macro.

Jira NVGPU-6371

Change-Id: I7a025f8f3687e104f61e0305096ac9e48d245a48
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2485732
(cherry picked from commit 6e373be0c5377b7c251787caa79934db9a389e70)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2493073
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
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>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Prateek sethi
2021-02-17 14:33:01 +05:30
committed by mobile promotions
parent 1d86da257b
commit fe03443161
2 changed files with 6 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -68,7 +68,7 @@ nvgpu_channel_user_syncpt_create(struct nvgpu_channel *ch)
{
struct gk20a *g = ch->g;
struct nvgpu_channel_user_syncpt *s;
char syncpt_name[32] = {0}; /* e.g. gp10b_42_user */
char syncpt_name[SYNCPT_NAME_SZ] = {0}; /* e.g. gp10b_42_user */
int err;
s = nvgpu_kzalloc(ch->g, sizeof(*s));
@@ -80,7 +80,7 @@ nvgpu_channel_user_syncpt_create(struct nvgpu_channel *ch)
s->nvhost = g->nvhost;
err = user_sync_build_debug_name(ch, syncpt_name,
sizeof(syncpt_name) - 1UL);
SYNCPT_NAME_SZ - 1UL);
if (err < 0) {
goto err_free;
}