]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mailbox: arm_mhuv2: clean up loop in get_irq_chan_comb()
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 14 Nov 2024 09:00:12 +0000 (12:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:04 +0000 (19:51 +0100)
commit8ac9fbe43789db185442fa962801bb68984536e1
tree8dd127dfef3dba1b2c33a1b5f7b550043e62f8d1
parent246896417a0e6a5426427447281bafb8016232c2
mailbox: arm_mhuv2: clean up loop in get_irq_chan_comb()

[ Upstream commit 192a16a3430ca459c4e986f3d10758c4d6b1aa29 ]

Both the inner and outer loops in this code use the "i" iterator.
The inner loop should really use a different iterator.

It doesn't affect things in practice because the data comes from the
device tree.  The "protocol" and "windows" variables are going to be
zero.  That means we're always going to hit the "return &chans[channel];"
statement and we're not going to want to iterate through the outer
loop again.

Still it's worth fixing this for future use cases.

Fixes: 5a6338cce9f4 ("mailbox: arm_mhuv2: Add driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mailbox/arm_mhuv2.c