Received: by 10.223.176.46 with SMTP id f43csp751266wra; Fri, 19 Jan 2018 01:08:02 -0800 (PST) X-Google-Smtp-Source: ACJfBosgSYTJigCcTdl9UbAKWklusieGlgagbrFzLlXoyCPcce6FqyG7UXwEP1VZF2VayNIjUe1y X-Received: by 10.98.7.207 with SMTP id 76mr21579710pfh.130.1516352882645; Fri, 19 Jan 2018 01:08:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516352882; cv=none; d=google.com; s=arc-20160816; b=WJTL70XmWEpU080ie3gW50ZLsHVRyEDmjmHKtEahxDikiQrb0wLvq+N+F3+ysDJdVq orTuAUNESMvfim4dqy5p65eihpgJs1j0TAmGleuZ4gsXJKjojKwWC4J2gJuXPm7zsWcL jmGGEVedXwu7IoWiuaB1XyLsfQhicDqjmoBVCZ3C5lQ50Au6Sm6aYZQ3EYJA0RE9O1Va lC0qe4ZJohJLGaG3w+89w2jT/E4KvhwmnYdX17p3YnaqOOD5O13x8Ly62+7z3damV69I Du3jL0s58dEE6ixVw9Zain5CZP3jsb7pI1M0CGD8pMsdXPU7O3uQWjvCwEOTRxnHP8Vg WFgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ru2Kek+yV8pTExzL23sMVuWXBGZtcKSvacsSxLYbbOI=; b=ZrIZLqDMCvFu+GUtHnlsiTTJwccdXe7PQxYNFGTpTUgiFKNaPMehx48arl02UE8YOy HOnMCLqdJtCkYx+5B0Q384GGwPusJCezZ2O21BCk1bAzseZ3nz/IEfW7iDOcWJuIRIjJ G3niOmeybrhF7IlzSJ4CftF9y2GCdch+vTY3Ge1jhme/gzD+WVFm5Vf35pRtvGUpi9cV yx6aAJDjFnRF+t2MQZf4YTMZ7JxmVJ/LTtPBTmZ83gIkRxg4DixHvWTzEXB/yEcvtGeK fwwNCUilxCIGipNs2DA5ESxW5Nz25fE2s3EyF5qVgUxEVzYdJJ5ChxnwDlKpQkDN5lbm 3CuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a96-v6si676738pli.745.2018.01.19.01.07.49; Fri, 19 Jan 2018 01:08:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755287AbeASJGA (ORCPT + 99 others); Fri, 19 Jan 2018 04:06:00 -0500 Received: from mga06.intel.com ([134.134.136.31]:52690 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754217AbeASJES (ORCPT ); Fri, 19 Jan 2018 04:04:18 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2018 01:04:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,381,1511856000"; d="scan'208";a="197007758" Received: from raj-desk2.iind.intel.com ([10.223.107.30]) by fmsmga006.fm.intel.com with ESMTP; 19 Jan 2018 01:03:59 -0800 From: Rajneesh Bhardwaj To: platform-driver-x86@vger.kernel.org Cc: dvhart@infradead.org, andy@infradead.org, linux-kernel@vger.kernel.org, vishwanath.somayaji@intel.com, srinivas.pandruvada@linux.intel.com, Rajneesh Bhardwaj Subject: [Patch v1 5/8] platform/x86: intel_pmc_core: Convert to ICPU macro Date: Fri, 19 Jan 2018 14:28:24 +0530 Message-Id: <1516352307-20123-6-git-send-email-rajneesh.bhardwaj@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516352307-20123-1-git-send-email-rajneesh.bhardwaj@intel.com> References: <1516352307-20123-1-git-send-email-rajneesh.bhardwaj@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use ICPU macro to refactor code related to x86_cpu_id for better readability. Suggested-by: Andriy Shevchenko Signed-off-by: Srinivas Pandruvada Signed-off-by: Rajneesh Bhardwaj --- drivers/platform/x86/intel_pmc_core.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index 549ee5852d4f..da9326740647 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -33,6 +33,9 @@ #include "intel_pmc_core.h" +#define ICPU(cpu, data) \ + { X86_VENDOR_INTEL, 6, cpu, X86_FEATURE_MWAIT, (kernel_ulong_t)data } + static struct pmc_dev pmc; static const struct pmc_bit_map spt_pll_map[] = { @@ -439,14 +442,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), {} }; -- 2.7.4