diff options
author | Jinjie Ruan <ruanjinjie@huawei.com> | 2023-08-30 11:03:44 +0200 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2023-09-20 14:51:54 +0200 |
commit | be6d43efb12455dbf85c96ff67582a463d34a0fc (patch) | |
tree | 917b08064868b878e78c8fdd8208ab2dbe5901fd /drivers/firmware | |
parent | Linux 6.6-rc1 (diff) | |
download | linux-be6d43efb12455dbf85c96ff67582a463d34a0fc.tar.xz linux-be6d43efb12455dbf85c96ff67582a463d34a0fc.zip |
firmware: ti_sci: Use list_for_each_entry() helper
Convert list_for_each() to list_for_each_entry() so that the p
list_head pointer and list_entry() call are no longer needed, which
can reduce a few lines of code. No functional changed.
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230830090344.528818-1-ruanjinjie@huawei.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/ti_sci.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 26a37f47f4ca..8444355539c6 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -2886,7 +2886,6 @@ static void ti_sci_setup_ops(struct ti_sci_info *info) const struct ti_sci_handle *ti_sci_get_handle(struct device *dev) { struct device_node *ti_sci_np; - struct list_head *p; struct ti_sci_handle *handle = NULL; struct ti_sci_info *info; @@ -2901,8 +2900,7 @@ const struct ti_sci_handle *ti_sci_get_handle(struct device *dev) } mutex_lock(&ti_sci_list_mutex); - list_for_each(p, &ti_sci_list) { - info = list_entry(p, struct ti_sci_info, node); + list_for_each_entry(info, &ti_sci_list, node) { if (ti_sci_np == info->dev->of_node) { handle = &info->handle; info->users++; @@ -3012,7 +3010,6 @@ const struct ti_sci_handle *ti_sci_get_by_phandle(struct device_node *np, struct ti_sci_handle *handle = NULL; struct device_node *ti_sci_np; struct ti_sci_info *info; - struct list_head *p; if (!np) { pr_err("I need a device pointer\n"); @@ -3024,8 +3021,7 @@ const struct ti_sci_handle *ti_sci_get_by_phandle(struct device_node *np, return ERR_PTR(-ENODEV); mutex_lock(&ti_sci_list_mutex); - list_for_each(p, &ti_sci_list) { - info = list_entry(p, struct ti_sci_info, node); + list_for_each_entry(info, &ti_sci_list, node) { if (ti_sci_np == info->dev->of_node) { handle = &info->handle; info->users++; |