Skip to content

Commit

Permalink
platform/x86: intel_pmc_core: Convert to ICPU macro
Browse files Browse the repository at this point in the history
Use ICPU macro to refactor code related to x86_cpu_id for better
readability.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
Rajneesh Bhardwaj authored and Andy Shevchenko committed Jan 29, 2018
1 parent 21ae435 commit 00f8b2f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/platform/x86/intel_pmc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

#include "intel_pmc_core.h"

#define ICPU(model, data) \
{ X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (kernel_ulong_t)data }

static struct pmc_dev pmc;

static const struct pmc_bit_map spt_pll_map[] = {
Expand Down Expand Up @@ -440,14 +443,10 @@ static inline void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
#endif /* CONFIG_DEBUG_FS */

static const struct x86_cpu_id intel_pmc_core_ids[] = {
{ X86_VENDOR_INTEL, 6, INTEL_FAM6_SKYLAKE_MOBILE, X86_FEATURE_MWAIT,
(kernel_ulong_t)&spt_reg_map},
{ X86_VENDOR_INTEL, 6, INTEL_FAM6_SKYLAKE_DESKTOP, X86_FEATURE_MWAIT,
(kernel_ulong_t)&spt_reg_map},
{ X86_VENDOR_INTEL, 6, INTEL_FAM6_KABYLAKE_MOBILE, X86_FEATURE_MWAIT,
(kernel_ulong_t)&spt_reg_map},
{ X86_VENDOR_INTEL, 6, INTEL_FAM6_KABYLAKE_DESKTOP, X86_FEATURE_MWAIT,
(kernel_ulong_t)&spt_reg_map},
ICPU(INTEL_FAM6_SKYLAKE_MOBILE, &spt_reg_map),
ICPU(INTEL_FAM6_SKYLAKE_DESKTOP, &spt_reg_map),
ICPU(INTEL_FAM6_KABYLAKE_MOBILE, &spt_reg_map),
ICPU(INTEL_FAM6_KABYLAKE_DESKTOP, &spt_reg_map),
{}
};

Expand Down

0 comments on commit 00f8b2f

Please sign in to comment.