Re: [PATCH v2 1/5] x86/topology: Export helper to get CPU number from APIC ID

From: Thomas Gleixner
Date: Tue Jun 25 2024 - 02:50:26 EST


On Mon, Jun 24 2024 at 16:20, Yazen Ghannam wrote:

> The need to look up a CPU number from an APIC ID is done in at least one
> other place outside of APIC/topology code:
> apei_smca_report_x86_error().

The need .... is done?

> #ifdef CONFIG_X86_LOCAL_APIC
> int topology_get_logical_id(u32 apicid, enum x86_topology_domains at_level);
> +int topology_get_cpunr(u32 apic_id);
> #else
> static inline int topology_get_logical_id(u32 apicid, enum x86_topology_domains at_level)
> {
> return 0;
> }
> +
> +static inline int topology_get_cpunr(u32 apic_id)
> +{
> + return -ENODEV;

Why ENODEV and not 0?

> +}
> #endif

Thanks,

tglx