diff --git a/drivers/gpu/nvgpu/common/sync/channel_user_syncpt.c b/drivers/gpu/nvgpu/common/sync/channel_user_syncpt.c index 5c53fc2ba..6382e8883 100644 --- a/drivers/gpu/nvgpu/common/sync/channel_user_syncpt.c +++ b/drivers/gpu/nvgpu/common/sync/channel_user_syncpt.c @@ -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; } diff --git a/drivers/gpu/nvgpu/common/sync/channel_user_syncpt_priv.h b/drivers/gpu/nvgpu/common/sync/channel_user_syncpt_priv.h index 0f30b50c7..2757e0105 100644 --- a/drivers/gpu/nvgpu/common/sync/channel_user_syncpt_priv.h +++ b/drivers/gpu/nvgpu/common/sync/channel_user_syncpt_priv.h @@ -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"), @@ -37,4 +37,6 @@ struct nvgpu_channel_user_syncpt { struct nvgpu_mem syncpt_buf; }; +#define SYNCPT_NAME_SZ 32UL + #endif /* NVGPU_USER_SYNC_PRIV_H */