Skip to content

Commit b6c55b1

Browse files
committed
ACPI: scan: Change acpi_scan_init() return value type to void
The only caller of acpi_scan_init(), acpi_init(), doesn't check its return value, so turn it into a void function. This avoids complaints from the Smatch static checker that the function should return a negative error code when it fails, which is not really a problem in this particular case. No intentional functional impact. Link: https://lore.kernel.org/linux-acpi/20220106082317.GA9123@kili/ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
1 parent bca2175 commit b6c55b1

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

drivers/acpi/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
int early_acpi_osi_init(void);
1515
int acpi_osi_init(void);
1616
acpi_status acpi_os_initialize1(void);
17-
int acpi_scan_init(void);
17+
void acpi_scan_init(void);
1818
#ifdef CONFIG_PCI
1919
void acpi_pci_root_init(void);
2020
void acpi_pci_link_init(void);

drivers/acpi/scan.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,9 +2542,8 @@ static void __init acpi_get_spcr_uart_addr(void)
25422542

25432543
static bool acpi_scan_initialized;
25442544

2545-
int __init acpi_scan_init(void)
2545+
void __init acpi_scan_init(void)
25462546
{
2547-
int result;
25482547
acpi_status status;
25492548
struct acpi_table_stao *stao_ptr;
25502549

@@ -2594,8 +2593,7 @@ int __init acpi_scan_init(void)
25942593
/*
25952594
* Enumerate devices in the ACPI namespace.
25962595
*/
2597-
result = acpi_bus_scan(ACPI_ROOT_OBJECT);
2598-
if (result)
2596+
if (acpi_bus_scan(ACPI_ROOT_OBJECT))
25992597
goto out;
26002598

26012599
acpi_root = acpi_fetch_acpi_dev(ACPI_ROOT_OBJECT);
@@ -2604,8 +2602,7 @@ int __init acpi_scan_init(void)
26042602

26052603
/* Fixed feature devices do not exist on HW-reduced platform */
26062604
if (!acpi_gbl_reduced_hardware) {
2607-
result = acpi_bus_scan_fixed();
2608-
if (result) {
2605+
if (acpi_bus_scan_fixed()) {
26092606
acpi_detach_data(acpi_root->handle,
26102607
acpi_scan_drop_device);
26112608
acpi_device_del(acpi_root);
@@ -2620,7 +2617,6 @@ int __init acpi_scan_init(void)
26202617

26212618
out:
26222619
mutex_unlock(&acpi_scan_lock);
2623-
return result;
26242620
}
26252621

26262622
static struct acpi_probe_entry *ape;

0 commit comments

Comments
 (0)