mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
MISRA Rule 14.2 requires for loop to be well-formed. A well-formed for loop has below requirements: 1. first clause can be empty or should assign value to a single loop counter 2. second clause should exist and use loop counter or loop control flag. It should not use any variable modified in the loop body. 3. third cluase should only update loop counter and should not use objects modified in the loop body. This modifies for loops to process single loop counter. The patch moves additional initializations before for loop, conditions at loop start and variable updates at the end of for loop. Jira NVGPU-855 Change-Id: I93ccf1ac0677ff355364a718d2d953467f1d9d95 Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2108188 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>