]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ACPI: acpi_watchdog: use LIST_HEAD for stack-allocated list
authorCan Peng <pengcan@kylinos.cn>
Tue, 9 Dec 2025 07:27:57 +0000 (15:27 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 7 Jan 2026 19:37:54 +0000 (20:37 +0100)
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>
drivers/acpi/acpi_watchdog.c

index 14b24157799cda5da7b66730701cb86fc602057c..709993c535d15069a1387550dd54711dcd15db7a 100644 (file)
@@ -103,7 +103,7 @@ void __init acpi_watchdog_init(void)
 {
        const struct acpi_wdat_entry *entries;
        const struct acpi_table_wdat *wdat;
-       struct list_head resource_list;
+       LIST_HEAD(resource_list);
        struct resource_entry *rentry;
        struct platform_device *pdev;
        struct resource *resources;
@@ -125,8 +125,6 @@ void __init acpi_watchdog_init(void)
            wdat->pci_device != 0xff || wdat->pci_function != 0xff)
                goto fail_put_wdat;
 
-       INIT_LIST_HEAD(&resource_list);
-
        entries = (struct acpi_wdat_entry *)(wdat + 1);
        for (i = 0; i < wdat->entries; i++) {
                const struct acpi_generic_address *gas;