aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-08-05 20:36:35 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-10 10:44:56 -0400
commitb990538a78ea84e89551ccaddf182beb5e16e6d2 (patch)
treea236cab3b4cbc307d648b3b41de4053698870f6d /drivers/edac
parent31983a04d686f9f90b356072089d8d677e40e776 (diff)
i7core_edac: CodingSyle fixes/cleanups
No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/i7core_edac.c50
1 files changed, 23 insertions, 27 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index f16aac253654..86037a601b54 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -38,10 +38,6 @@
38#define I7CORE_REVISION " Ver: 1.0.0 " __DATE__ 38#define I7CORE_REVISION " Ver: 1.0.0 " __DATE__
39#define EDAC_MOD_STR "i7core_edac" 39#define EDAC_MOD_STR "i7core_edac"
40 40
41/* HACK: temporary, just to enable all logs, for now */
42#undef debugf0
43#define debugf0(fmt, arg...) edac_printk(KERN_INFO, "i7core", fmt, ##arg)
44
45/* 41/*
46 * Debug macros 42 * Debug macros
47 */ 43 */
@@ -105,6 +101,7 @@
105 #define REPEAT_EN 0x01 101 #define REPEAT_EN 0x01
106 102
107 /* OFFSETS for Devices 4,5 and 6 Function 1 */ 103 /* OFFSETS for Devices 4,5 and 6 Function 1 */
104
108#define MC_DOD_CH_DIMM0 0x48 105#define MC_DOD_CH_DIMM0 0x48
109#define MC_DOD_CH_DIMM1 0x4c 106#define MC_DOD_CH_DIMM1 0x4c
110#define MC_DOD_CH_DIMM2 0x50 107#define MC_DOD_CH_DIMM2 0x50
@@ -227,7 +224,7 @@ struct pci_id_descr pci_devs[] = {
227 /* Memory controller */ 224 /* Memory controller */
228 { PCI_DESCR(3, 0, PCI_DEVICE_ID_INTEL_I7_MCR) }, 225 { PCI_DESCR(3, 0, PCI_DEVICE_ID_INTEL_I7_MCR) },
229 { PCI_DESCR(3, 1, PCI_DEVICE_ID_INTEL_I7_MC_TAD) }, 226 { PCI_DESCR(3, 1, PCI_DEVICE_ID_INTEL_I7_MC_TAD) },
230 { PCI_DESCR(3, 2, PCI_DEVICE_ID_INTEL_I7_MC_RAS) }, /* if RDIMM is supported */ 227 { PCI_DESCR(3, 2, PCI_DEVICE_ID_INTEL_I7_MC_RAS) }, /* if RDIMM */
231 { PCI_DESCR(3, 4, PCI_DEVICE_ID_INTEL_I7_MC_TEST) }, 228 { PCI_DESCR(3, 4, PCI_DEVICE_ID_INTEL_I7_MC_TEST) },
232 229
233 /* Channel 0 */ 230 /* Channel 0 */
@@ -878,7 +875,7 @@ static int write_and_test(struct pci_dev *dev, int where, u32 val)
878 875
879 for (count = 0; count < 10; count++) { 876 for (count = 0; count < 10; count++) {
880 if (count) 877 if (count)
881 msleep (100); 878 msleep(100);
882 pci_write_config_dword(dev, where, val); 879 pci_write_config_dword(dev, where, val);
883 pci_read_config_dword(dev, where, &read); 880 pci_read_config_dword(dev, where, &read);
884 881
@@ -894,7 +891,6 @@ static int write_and_test(struct pci_dev *dev, int where, u32 val)
894 return -EINVAL; 891 return -EINVAL;
895} 892}
896 893
897
898/* 894/*
899 * This routine prepares the Memory Controller for error injection. 895 * This routine prepares the Memory Controller for error injection.
900 * The error will be injected when some process tries to write to the 896 * The error will be injected when some process tries to write to the
@@ -1326,7 +1322,7 @@ static void check_mc_test_err(struct mem_ctl_info *mci, u8 socket)
1326 int new0, new1, new2; 1322 int new0, new1, new2;
1327 1323
1328 if (!pvt->pci_mcr[socket][4]) { 1324 if (!pvt->pci_mcr[socket][4]) {
1329 debugf0("%s MCR registers not found\n",__func__); 1325 debugf0("%s MCR registers not found\n", __func__);
1330 return; 1326 return;
1331 } 1327 }
1332 1328
@@ -1405,24 +1401,24 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
1405 type = "NON_FATAL"; 1401 type = "NON_FATAL";
1406 1402
1407 switch (optypenum) { 1403 switch (optypenum) {
1408 case 0: 1404 case 0:
1409 optype = "generic undef request"; 1405 optype = "generic undef request";
1410 break; 1406 break;
1411 case 1: 1407 case 1:
1412 optype = "read error"; 1408 optype = "read error";
1413 break; 1409 break;
1414 case 2: 1410 case 2:
1415 optype = "write error"; 1411 optype = "write error";
1416 break; 1412 break;
1417 case 3: 1413 case 3:
1418 optype = "addr/cmd error"; 1414 optype = "addr/cmd error";
1419 break; 1415 break;
1420 case 4: 1416 case 4:
1421 optype = "scrubbing error"; 1417 optype = "scrubbing error";
1422 break; 1418 break;
1423 default: 1419 default:
1424 optype = "reserved"; 1420 optype = "reserved";
1425 break; 1421 break;
1426 } 1422 }
1427 1423
1428 switch (errnum) { 1424 switch (errnum) {
@@ -1672,7 +1668,7 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
1672 spin_lock_init(&pvt->mce_lock); 1668 spin_lock_init(&pvt->mce_lock);
1673 1669
1674 rc = edac_mce_register(&pvt->edac_mce); 1670 rc = edac_mce_register(&pvt->edac_mce);
1675 if (unlikely (rc < 0)) { 1671 if (unlikely(rc < 0)) {
1676 debugf0("MC: " __FILE__ 1672 debugf0("MC: " __FILE__
1677 ": %s(): failed edac_mce_register()\n", __func__); 1673 ": %s(): failed edac_mce_register()\n", __func__);
1678 goto fail1; 1674 goto fail1;