From: Zhi Wang Date: Fri, 24 Jan 2025 18:29:51 +0000 (-0800) Subject: drm/nouveau: remove the magic number in r535_gsp_rpc_push() X-Git-Tag: v6.15-rc1~120^2~20^2~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bb9bb50a493ad349262edbd81e3f3c583e28122;p=thirdparty%2Fkernel%2Fstable.git drm/nouveau: remove the magic number in r535_gsp_rpc_push() There has been a GSP_MSG_MAX_SIZE which represents the max size of a GSP message element header. Use it instead of a magic number. No functional change is intended. Signed-off-by: Zhi Wang Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-9-zhiw@nvidia.com --- diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c index 4e11369996785..78b5dc66f9e01 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c @@ -796,7 +796,7 @@ r535_gsp_rpc_push(struct nvkm_gsp *gsp, void *payload, bool wait, { struct nvfw_gsp_rpc *rpc = to_gsp_hdr(payload, rpc); struct r535_gsp_msg *cmd = to_gsp_hdr(rpc, cmd); - const u32 max_msg_size = (16 * 0x1000) - sizeof(struct r535_gsp_msg); + const u32 max_msg_size = GSP_MSG_MAX_SIZE - sizeof(*cmd); const u32 max_rpc_size = max_msg_size - sizeof(*rpc); u32 rpc_size = rpc->length - sizeof(*rpc); void *repv;