Files
linux-nv-oot/drivers/media
Jon Hunter 2ff6b64efd media: camera: Fix declaration-after-statement
The camera driver fails to build if the compiler option
-Werror=declaration-after-statement is enabled and the following error
is seen ...

 drivers/media/platform/tegra/camera/tegracam_ctrls.c:1120:17: error:
 ISO C90 forbids mixed declarations and code
 [-Werror=declaration-after-statement]
  1120 |                 int index = tegracam_get_ctrl_index(cid);
       |                 ^~~

JIRA CAMERASW-32529

Fix this by moving the declaration of the 'index' and 'size' variables
to the start of the for-loop code block.

Change-Id: I69590c147e8effd031b962606a077856ad4f8d07
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3316537
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mike Jia <mijia@nvidia.com>
2025-07-24 10:19:16 +00:00
..