[PATCH 3/3] firmware: arm_scmi: Convert to list_for_each_entry()

Geert Uytterhoeven
2026-04-03T08:41:48Z

Simplify the loop in scmi_handle_get() by using list_for_each_entry().

Suggested-by: Marek Vasut <marek.vasut@mailbox.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/firmware/arm_scmi/driver.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 57785c0c04241e46..b1bba2c61b728b56 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -2584,13 +2584,11 @@ static bool scmi_is_transport_atomic(const struct scmi_handle *handle,
*/
static struct scmi_handle *scmi_handle_get(struct device *dev)
{
- struct list_head *p;
struct scmi_info *info;
struct scmi_handle *handle = NULL;

mutex_lock(&scmi_list_mutex);
- list_for_each(p, &scmi_list) {
- info = list_entry(p, struct scmi_info, node);
+ list_for_each_entry(info, &scmi_list, node) {
if (dev->parent == info->dev) {
info->users++;
handle = &info->handle;
--
2.43.0