]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
remoteproc: st: Fix indexing of memory-regions
authorBjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Wed, 26 Nov 2025 18:17:59 +0000 (12:17 -0600)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Thu, 27 Nov 2025 15:35:19 +0000 (08:35 -0700)
The recent transition to use of_reserved_mem_region_to_resource()
changes the while loop to a for loop, but the increment of the "index"
variable was left behind at the end of the loop, as highlighted by the
following error/warning:

  error: variable 'index' is incremented both in the loop header and in the loop body [-Werror,-Wfor-loop-analysis]

Drop the extra increment to avoid skipping over every other
memory-region in the loop.

Fixes: 67a7bc7f0358 ("remoteproc: Use of_reserved_mem_region_* functions for "memory-region"")
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251126-st-remoteproc-double-index-v1-1-3b0a8b21ac18@oss.qualcomm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/st_remoteproc.c

index 747bbe7f6f7c6be160f4f6a0202eb8df20dc5bc9..a07edf7217d21a3f08d26592e8a14814608507f8 100644 (file)
@@ -155,7 +155,6 @@ static int st_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
                        return -ENOMEM;
 
                rproc_add_carveout(rproc, mem);
-               index++;
        }
 
        return rproc_elf_load_rsc_table(rproc, fw);