Re: [PATCH RESEND v10 5/8] ACPI: Centralize acpi_get_cpu_uid() declaration in include/linux/acpi.h
| Newsgroups | org.kernel.vger.linux-perf-users,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Build breakage when CONFIG_ACPI is disabled due to missing acpi_get_cpu_uid() stub. -- --- Patch [5]: [PATCH RESEND v10 5/8] ACPI: Centralize acpi_get_cpu_uid() declaration in include/linux/acpi.h --- commit f99931b839a856d11d22796fd0c23424af139915 Author: Chengwen Feng <[email protected]> ACPI: Centralize acpi_get_cpu_uid() declaration in include/linux/acpi.h This commit centralizes the acpi_get_cpu_uid() declaration into the global scope in include/linux/acpi.h and removes the architecture-specific declarations. This unifies the interface and eliminates duplicate prototypes. > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index fbf0c3a65f598..f7e50e9cfb224 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h [ ... ] > @@ -323,6 +323,17 @@ int acpi_unmap_cpu(int cpu); > > acpi_handle acpi_get_processor_handle(int cpu); > > +/** > + * acpi_get_cpu_uid() - Get ACPI Processor UID of from MADT table > + * @cpu: Logical CPU number (0-based) > + * @uid: Pointer to store ACPI Processor UID > + * > + * Return: 0 on success (ACPI Processor ID stored in *uid); > + * -EINVAL if CPU number is invalid or out of range; > + * -ENODEV if ACPI Processor UID for the CPU is not found. > + */ > +int acpi_get_cpu_uid(unsigned int cpu, u32 *uid); > + [Severity: Low] Does this cause a build failure when CONFIG_ACPI is disabled? The declaration is added here, but it appears there is no static inline stub provided in the !CONFIG_ACPI section of the header. Callers outside of ACPI-specific code seem to use this function unconditionally. For example, in arch/x86/xen/enlighten_hvm.c within xen_cpu_up_prepare_hvm(): if (acpi_get_cpu_uid(cpu, &cpu_uid) == 0) Without a static inline stub returning an error code (like -ENODEV) when CONFIG_ACPI is not set, does compiling x86 with CONFIG_XEN_PVHVM enabled and CONFIG_ACPI disabled result in an implicit function declaration and undefined reference linker error? > #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC > int acpi_get_ioapic_id(acpi_handle handle, u32 gsi_base, u64 *phys_addr); > #endif -- Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5