]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_scmi: Convert to list_for_each_entry()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 3 Apr 2026 08:41:31 +0000 (10:41 +0200)
committerSudeep Holla <sudeep.holla@kernel.org>
Tue, 5 May 2026 14:45:59 +0000 (15:45 +0100)
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>
Link: https://patch.msgid.link/bccbd4a64ef4619afd5454e9e533073b00aeaba6.1775205358.git.geert+renesas@glider.be
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
drivers/firmware/arm_scmi/driver.c

index f7ee1b1495d7e67c59a5b748762994d522ec8ccf..53310beb67a879272b7b48f35d65ada484c2af66 100644 (file)
@@ -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;