Skip to content

Commit b0c8ac5

Browse files
Can Pengrafaeljw
authored andcommitted
ACPI: acpi_watchdog: use LIST_HEAD for stack-allocated list
Replace the separate declaration of 'resource_list' and subsequent INIT_LIST_HEAD() call with LIST_HEAD(), which declares and initializes the list head in one idiomatic step. This reduces code verbosity and aligns with common kernel coding patterns, without functional change. Signed-off-by: Can Peng <pengcan@kylinos.cn> [ rjw: Subject edits ] Link: https://patch.msgid.link/20251209072757.3110467-1-pengcan@kylinos.cn Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9ace475 commit b0c8ac5

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/acpi/acpi_watchdog.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void __init acpi_watchdog_init(void)
103103
{
104104
const struct acpi_wdat_entry *entries;
105105
const struct acpi_table_wdat *wdat;
106-
struct list_head resource_list;
106+
LIST_HEAD(resource_list);
107107
struct resource_entry *rentry;
108108
struct platform_device *pdev;
109109
struct resource *resources;
@@ -125,8 +125,6 @@ void __init acpi_watchdog_init(void)
125125
wdat->pci_device != 0xff || wdat->pci_function != 0xff)
126126
goto fail_put_wdat;
127127

128-
INIT_LIST_HEAD(&resource_list);
129-
130128
entries = (struct acpi_wdat_entry *)(wdat + 1);
131129
for (i = 0; i < wdat->entries; i++) {
132130
const struct acpi_generic_address *gas;

0 commit comments

Comments
 (0)