From: Geert Uytterhoeven Date: Fri, 3 Apr 2026 08:41:31 +0000 (+0200) Subject: firmware: arm_scmi: Convert to list_for_each_entry() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=145728fb616a62e5a2642f2efd3829f7c8874958;p=thirdparty%2Fkernel%2Flinux.git firmware: arm_scmi: Convert to list_for_each_entry() Simplify the loop in scmi_handle_get() by using list_for_each_entry(). Suggested-by: Marek Vasut Signed-off-by: Geert Uytterhoeven Link: https://patch.msgid.link/bccbd4a64ef4619afd5454e9e533073b00aeaba6.1775205358.git.geert+renesas@glider.be Signed-off-by: Sudeep Holla --- diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index f7ee1b1495d7e..53310beb67a87 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -2552,13 +2552,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;