Re: [patch 19/22] ASoC: Intel: Convert to new X86 CPU match macros

From: Andy Shevchenko
Date: Fri Mar 20 2020 - 10:58:50 EST


On Fri, Mar 20, 2020 at 3:18 PM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> The new macro set has a consistent namespace and uses C99 initializers
> instead of the grufty C89 ones.
>
> Get rid the of the local macro wrappers for consistency.

> -#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
> -
> #define SOC_INTEL_IS_CPU(soc, type) \
> static inline bool soc_intel_is_##soc(void) \
> { \
> static const struct x86_cpu_id soc##_cpu_ids[] = { \
> - ICPU(type), \
> + X86_MATCH_INTEL_FAM6_MODEL(type, NULL), \
> {} \
> }; \
> const struct x86_cpu_id *id; \
> @@ -32,11 +30,11 @@ static inline bool soc_intel_is_##soc(vo
> return false; \
> }
>

> +SOC_INTEL_IS_CPU(byt, ATOM_SILVERMONT);
> +SOC_INTEL_IS_CPU(cht, ATOM_AIRMONT);
> +SOC_INTEL_IS_CPU(apl, ATOM_GOLDMONT);
> +SOC_INTEL_IS_CPU(glk, ATOM_GOLDMONT_PLUS);
> +SOC_INTEL_IS_CPU(cml, KABYLAKE_L);

I'm wondering if driver data can be used in one macro to distinguish
which CPU we are run on.
Takashi, what do you think?

--
With Best Regards,
Andy Shevchenko