mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
pva: Fix mixed declarations and code
When building the PVA driver with the compiler option
'-Werror=declaration-after-statement' the build fails with the following
error ...
drivers/video/tegra/host/pva/./src/kmd/common/pva_kmd_shared_buffer.c:
In function ‘shared_buffer_process_msg’:
drivers/video/tegra/host/pva/./src/kmd/common/pva_kmd_shared_buffer.c:
error: ISO C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]
187 | uint32_t msg_size = safe_subu32(header.size, sizeof(header));
| ^~~~~~~~
Fix this build issue by ensuring the variable 'msg_size' is defined at
the start of the shared_buffer_process_msg() function.
Change-Id: Ibd4a51caae06bfda2e11dfc6e3f1cf2f26d618c7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330348
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mohnish Jain <mohnishj@nvidia.com>
Reviewed-by: Nan Wang <nanwa@nvidia.com>
This commit is contained in:
@@ -179,12 +179,13 @@ static void shared_buffer_process_msg(struct pva_kmd_device *pva,
|
||||
struct pva_kmd_fw_msg_res_unreg unreg_data;
|
||||
struct pva_kmd_context *ctx = NULL;
|
||||
void *msg_body;
|
||||
uint32_t msg_size;
|
||||
|
||||
ASSERT(msg != NULL);
|
||||
|
||||
// Copy the header
|
||||
memcpy(&header, msg, sizeof(header));
|
||||
uint32_t msg_size = safe_subu32(header.size, sizeof(header));
|
||||
msg_size = safe_subu32(header.size, sizeof(header));
|
||||
msg_body = (uint8_t *)msg + sizeof(header);
|
||||
|
||||
switch (header.type) {
|
||||
|
||||
Reference in New Issue
Block a user