mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: Dave Hansen <dave@sr71.net>,
	dave.hansen@intel.com, mchehab@kernel.org,
	dougthompson@xmission.com, bp@alien8.de,
	linux-edac@vger.kernel.org, tony.luck@intel.com
Subject: [PATCH] edac: use Intel Model Macros instead of open-coding them
Date: Thu, 29 Sep 2016 13:43:21 -0700	[thread overview]
Message-ID: <20160929204321.9FAE5F84@viggo.jf.intel.com> (raw)


From: Dave Hansen <dave.hansen@intel.com>

We now have symbolic names for a bunch of Intel cpu modes via
asm/intel-family.h.  The original conversion missed the edac
drivers.  Convert them.

Signed-off-by: Dave Hansen <dave.hansen@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Doug Thompson <dougthompson@xmission.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: linux-edac@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Tony Luck <tony.luck@intel.com>
---

 b/drivers/edac/sb_edac.c  |   13 +++++++------
 b/drivers/edac/skx_edac.c |    3 ++-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff -puN drivers/edac/sb_edac.c~sb-edac-model-numbers drivers/edac/sb_edac.c
--- a/drivers/edac/sb_edac.c~sb-edac-model-numbers	2016-09-29 13:16:04.057377422 -0700
+++ b/drivers/edac/sb_edac.c	2016-09-29 13:19:56.429865892 -0700
@@ -23,6 +23,7 @@
 #include <linux/math64.h>
 #include <linux/mod_devicetable.h>
 #include <asm/cpu_device_id.h>
+#include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/mce.h>
 
@@ -3366,12 +3367,12 @@ fail0:
 	{ X86_VENDOR_INTEL, 6, model, 0, (unsigned long)&table }
 
 static const struct x86_cpu_id sbridge_cpuids[] = {
-	ICPU(0x2d, pci_dev_descr_sbridge_table),	/* SANDY_BRIDGE */
-	ICPU(0x3e, pci_dev_descr_ibridge_table),	/* IVY_BRIDGE */
-	ICPU(0x3f, pci_dev_descr_haswell_table),	/* HASWELL */
-	ICPU(0x4f, pci_dev_descr_broadwell_table),	/* BROADWELL */
-	ICPU(0x56, pci_dev_descr_broadwell_table),	/* BROADWELL-DE */
-	ICPU(0x57, pci_dev_descr_knl_table),		/* KNIGHTS_LANDING */
+	ICPU(INTEL_FAM6_SANDYBRIDGE_X,	  pci_dev_descr_sbridge_table),
+	ICPU(INTEL_FAM6_IVYBRIDGE_X,	  pci_dev_descr_ibridge_table),
+	ICPU(INTEL_FAM6_HASWELL_X,	  pci_dev_descr_haswell_table),
+	ICPU(INTEL_FAM6_BROADWELL_X,	  pci_dev_descr_broadwell_table),
+	ICPU(INTEL_FAM6_BROADWELL_XEON_D, pci_dev_descr_broadwell_table),
+	ICPU(INTEL_FAM6_XEON_PHI_KNL,	  pci_dev_descr_knl_table),
 	{ }
 };
 MODULE_DEVICE_TABLE(x86cpu, sbridge_cpuids);
diff -puN drivers/edac/skx_edac.c~sb-edac-model-numbers drivers/edac/skx_edac.c
--- a/drivers/edac/skx_edac.c~sb-edac-model-numbers	2016-09-29 13:24:47.998026243 -0700
+++ b/drivers/edac/skx_edac.c	2016-09-29 13:27:44.992015124 -0700
@@ -25,6 +25,7 @@
 #include <linux/math64.h>
 #include <linux/mod_devicetable.h>
 #include <asm/cpu_device_id.h>
+#include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/mce.h>
 
@@ -263,7 +264,7 @@ fail:
 }
 
 const struct x86_cpu_id skx_cpuids[] = {
-	{ X86_VENDOR_INTEL, 6, 0x55, 0, 0 },	/* Skylake */
+	{ X86_VENDOR_INTEL, 6, INTEL_FAM6_SKYLAKE_X, 0, 0 },	/* Skylake */
 	{ }
 };
 MODULE_DEVICE_TABLE(x86cpu, skx_cpuids);
_

                 reply	other threads:[~2016-09-29 20:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160929204321.9FAE5F84@viggo.jf.intel.com \
    --to=dave@sr71.net \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dougthompson@xmission.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®