Skip to content

Commit

Permalink
dmaengine: ti: edma: make the loop condition simpler in edma_probe()
Browse files Browse the repository at this point in the history
When i == ecc->num_tc, the edma_probe() calls
of_parse_phandle_with_fixed_args() and breaks from the loop regardless
of the return value. Since neither the returned value nor the output
argument tc_args is used, set i < ecc->num_tc as the loop condition.

Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20241219020507.1983124-2-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Joe Hattori authored and Vinod Koul committed Dec 24, 2024
1 parent 66d88e1 commit 0ab4331
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/dma/ti/edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -2460,10 +2460,10 @@ static int edma_probe(struct platform_device *pdev)
goto err_reg1;
}

for (i = 0;; i++) {
for (i = 0; i < ecc->num_tc; i++) {
ret = of_parse_phandle_with_fixed_args(node, "ti,tptcs",
1, i, &tc_args);
if (ret || i == ecc->num_tc)
if (ret)
break;

ecc->tc_list[i].node = tc_args.np;
Expand Down

0 comments on commit 0ab4331

Please sign in to comment.