ACPI: Use LIST_HEAD() to initialize on stack list head
Subsystems (2)
PATCH 1/1 ACPI: Use LIST_HEAD() to initialize on stack list head
Use LIST_HEAD to initialize on stack list head. No intentional functional impact.
Change generated with below coccinelle script:
@@
identifier name;
@@
- struct list_head name;
+ LIST_HEAD(name);
... when != name
- INIT_LIST_HEAD(&name);
Signed-off-by Jisheng Zhang <[email protected]>
--- drivers/acpi/acpi_apd.c | 3 +-- drivers/acpi/arm64/amba.c | 3 +-- drivers/acpi/resource.c | 3 +-- drivers/acpi/scan.c | 3 +-- drivers/acpi/x86/lpss.c | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-)
drivers/acpi/acpi_apd.c +1 -2
@@ -68,14 +68,13 @@ static int fch_misc_setup(struct apd_private_data *pdata)struct platform_device *clkdev;struct fch_clk_data *clk_data;struct resource_entry *rentry; -struct list_head resource_list; +LIST_HEAD (resource_list);int ret; clk_data =devm_kzalloc (&adev->dev,sizeof (*clk_data),GFP_KERNEL );if (!clk_data)return -ENOMEM ; -INIT_LIST_HEAD (&resource_list); ret =acpi_dev_get_memory_resources (adev, &resource_list);if (ret <0 )return -ENOENT ;
drivers/acpi/arm64/amba.c +1 -2
@@ -39,7 +39,7 @@ static int amba_handler_attach(struct acpi_device *adev,struct acpi_device *parent =acpi_dev_parent (adev);struct amba_device *dev;struct resource_entry *rentry; -struct list_head resource_list; +LIST_HEAD (resource_list);bool address_found = false;int irq_no =0 ;int ret;
@@ -55,7 +55,6 @@ static int amba_handler_attach(struct acpi_device *adev,return -ENOMEM ; } -INIT_LIST_HEAD (&resource_list); ret =acpi_dev_get_resources (adev, &resource_list,NULL ,NULL );if (ret <0 ) goto err_free;
drivers/acpi/resource.c +1 -2
@@ -1118,11 +1118,10 @@ EXPORT_SYMBOL_GPL(acpi_dev_filter_resource_type);static int acpi_dev_consumes_res (struct acpi_device *adev,struct resource *res) { -struct list_head resource_list; +LIST_HEAD (resource_list);struct resource_entry *rentry;int ret, found =0 ; -INIT_LIST_HEAD (&resource_list); ret =acpi_dev_get_resources (adev, &resource_list,NULL ,NULL );if (ret <0 )return 0 ;
drivers/acpi/scan.c +1 -2
@@ -1738,7 +1738,7 @@ static bool acpi_is_indirect_io_slave(struct acpi_device *device)static bool acpi_device_enumeration_by_parent (struct acpi_device *device) { -struct list_head resource_list; +LIST_HEAD (resource_list);bool is_serial_bus_slave = false;static const struct acpi_device_id ignore_serial_bus_ids[] = {/*
@@ -1792,7 +1792,6 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)if (!acpi_match_device_ids (device, ignore_serial_bus_ids))return false; -INIT_LIST_HEAD (&resource_list);acpi_dev_get_resources (device, &resource_list, acpi_check_serial_bus_slave, &is_serial_bus_slave);
drivers/acpi/x86/lpss.c +1 -2
@@ -615,7 +615,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev,const struct lpss_device_desc *dev_desc;struct lpss_private_data *pdata;struct resource_entry *rentry; -struct list_head resource_list; +LIST_HEAD (resource_list);struct platform_device *pdev;int ret;
@@ -627,7 +627,6 @@ static int acpi_lpss_create_device(struct acpi_device *adev,if (!pdata)return -ENOMEM ; -INIT_LIST_HEAD (&resource_list); ret =acpi_dev_get_memory_resources (adev, &resource_list);if (ret <0 ) goto err_out;
Signature · 1 line
2.53.0