Commit 849a4c37 authored by Dave Jiang's avatar Dave Jiang Committed by Linus Torvalds

drivers/edac: Lindent e7xxx

Lindent cleanup of e7xxx_edac driver
Signed-off-by: default avatarDave Jiang <djiang@mvista.com>
Signed-off-by: default avatarDouglas Thompson <dougthompson@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f4aff426
...@@ -147,20 +147,16 @@ struct e7xxx_error_info { ...@@ -147,20 +147,16 @@ struct e7xxx_error_info {
static const struct e7xxx_dev_info e7xxx_devs[] = { static const struct e7xxx_dev_info e7xxx_devs[] = {
[E7500] = { [E7500] = {
.err_dev = PCI_DEVICE_ID_INTEL_7500_1_ERR, .err_dev = PCI_DEVICE_ID_INTEL_7500_1_ERR,
.ctl_name = "E7500" .ctl_name = "E7500"},
},
[E7501] = { [E7501] = {
.err_dev = PCI_DEVICE_ID_INTEL_7501_1_ERR, .err_dev = PCI_DEVICE_ID_INTEL_7501_1_ERR,
.ctl_name = "E7501" .ctl_name = "E7501"},
},
[E7505] = { [E7505] = {
.err_dev = PCI_DEVICE_ID_INTEL_7505_1_ERR, .err_dev = PCI_DEVICE_ID_INTEL_7505_1_ERR,
.ctl_name = "E7505" .ctl_name = "E7505"},
},
[E7205] = { [E7205] = {
.err_dev = PCI_DEVICE_ID_INTEL_7205_1_ERR, .err_dev = PCI_DEVICE_ID_INTEL_7205_1_ERR,
.ctl_name = "E7205" .ctl_name = "E7205"},
},
}; };
/* FIXME - is this valid for both SECDED and S4ECD4ED? */ /* FIXME - is this valid for both SECDED and S4ECD4ED? */
...@@ -184,7 +180,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, ...@@ -184,7 +180,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
unsigned long page) unsigned long page)
{ {
u32 remap; u32 remap;
struct e7xxx_pvt *pvt = (struct e7xxx_pvt *) mci->pvt_info; struct e7xxx_pvt *pvt = (struct e7xxx_pvt *)mci->pvt_info;
debugf3("%s()\n", __func__); debugf3("%s()\n", __func__);
...@@ -201,8 +197,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, ...@@ -201,8 +197,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
return pvt->tolm - 1; return pvt->tolm - 1;
} }
static void process_ce(struct mem_ctl_info *mci, static void process_ce(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
struct e7xxx_error_info *info)
{ {
u32 error_1b, page; u32 error_1b, page;
u16 syndrome; u16 syndrome;
...@@ -229,8 +224,7 @@ static void process_ce_no_info(struct mem_ctl_info *mci) ...@@ -229,8 +224,7 @@ static void process_ce_no_info(struct mem_ctl_info *mci)
edac_mc_handle_ce_no_info(mci, "e7xxx CE log register overflow"); edac_mc_handle_ce_no_info(mci, "e7xxx CE log register overflow");
} }
static void process_ue(struct mem_ctl_info *mci, static void process_ue(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
struct e7xxx_error_info *info)
{ {
u32 error_2b, block_page; u32 error_2b, block_page;
int row; int row;
...@@ -250,16 +244,14 @@ static void process_ue_no_info(struct mem_ctl_info *mci) ...@@ -250,16 +244,14 @@ static void process_ue_no_info(struct mem_ctl_info *mci)
edac_mc_handle_ue_no_info(mci, "e7xxx UE log register overflow"); edac_mc_handle_ue_no_info(mci, "e7xxx UE log register overflow");
} }
static void e7xxx_get_error_info (struct mem_ctl_info *mci, static void e7xxx_get_error_info(struct mem_ctl_info *mci,
struct e7xxx_error_info *info) struct e7xxx_error_info *info)
{ {
struct e7xxx_pvt *pvt; struct e7xxx_pvt *pvt;
pvt = (struct e7xxx_pvt *) mci->pvt_info; pvt = (struct e7xxx_pvt *)mci->pvt_info;
pci_read_config_byte(pvt->bridge_ck, E7XXX_DRAM_FERR, pci_read_config_byte(pvt->bridge_ck, E7XXX_DRAM_FERR, &info->dram_ferr);
&info->dram_ferr); pci_read_config_byte(pvt->bridge_ck, E7XXX_DRAM_NERR, &info->dram_nerr);
pci_read_config_byte(pvt->bridge_ck, E7XXX_DRAM_NERR,
&info->dram_nerr);
if ((info->dram_ferr & 1) || (info->dram_nerr & 1)) { if ((info->dram_ferr & 1) || (info->dram_nerr & 1)) {
pci_read_config_dword(pvt->bridge_ck, E7XXX_DRAM_CELOG_ADD, pci_read_config_dword(pvt->bridge_ck, E7XXX_DRAM_CELOG_ADD,
...@@ -280,8 +272,9 @@ static void e7xxx_get_error_info (struct mem_ctl_info *mci, ...@@ -280,8 +272,9 @@ static void e7xxx_get_error_info (struct mem_ctl_info *mci,
pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_NERR, 0x03, 0x03); pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_NERR, 0x03, 0x03);
} }
static int e7xxx_process_error_info (struct mem_ctl_info *mci, static int e7xxx_process_error_info(struct mem_ctl_info *mci,
struct e7xxx_error_info *info, int handle_errors) struct e7xxx_error_info *info,
int handle_errors)
{ {
int error_found; int error_found;
...@@ -342,7 +335,6 @@ static inline int dual_channel_active(u32 drc, int dev_idx) ...@@ -342,7 +335,6 @@ static inline int dual_channel_active(u32 drc, int dev_idx)
return (dev_idx == E7501) ? ((drc >> 22) & 0x1) : 1; return (dev_idx == E7501) ? ((drc >> 22) & 0x1) : 1;
} }
/* Return DRB granularity (0=32mb, 1=64mb). */ /* Return DRB granularity (0=32mb, 1=64mb). */
static inline int drb_granularity(u32 drc, int dev_idx) static inline int drb_granularity(u32 drc, int dev_idx)
{ {
...@@ -350,7 +342,6 @@ static inline int drb_granularity(u32 drc, int dev_idx) ...@@ -350,7 +342,6 @@ static inline int drb_granularity(u32 drc, int dev_idx)
return (dev_idx == E7501) ? ((drc >> 18) & 0x3) : 1; return (dev_idx == E7501) ? ((drc >> 18) & 0x3) : 1;
} }
static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
int dev_idx, u32 drc) int dev_idx, u32 drc)
{ {
...@@ -422,7 +413,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) ...@@ -422,7 +413,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
debugf0("%s(): mci\n", __func__); debugf0("%s(): mci\n", __func__);
/* make sure error reporting method is sane */ /* make sure error reporting method is sane */
switch(edac_op_state) { switch (edac_op_state) {
case EDAC_OPSTATE_POLL: case EDAC_OPSTATE_POLL:
case EDAC_OPSTATE_NMI: case EDAC_OPSTATE_NMI:
break; break;
...@@ -448,11 +439,10 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) ...@@ -448,11 +439,10 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
mci->mod_ver = E7XXX_REVISION; mci->mod_ver = E7XXX_REVISION;
mci->dev = &pdev->dev; mci->dev = &pdev->dev;
debugf3("%s(): init pvt\n", __func__); debugf3("%s(): init pvt\n", __func__);
pvt = (struct e7xxx_pvt *) mci->pvt_info; pvt = (struct e7xxx_pvt *)mci->pvt_info;
pvt->dev_info = &e7xxx_devs[dev_idx]; pvt->dev_info = &e7xxx_devs[dev_idx];
pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
pvt->dev_info->err_dev, pvt->dev_info->err_dev, pvt->bridge_ck);
pvt->bridge_ck);
if (!pvt->bridge_ck) { if (!pvt->bridge_ck) {
e7xxx_printk(KERN_ERR, "error reporting device not found:" e7xxx_printk(KERN_ERR, "error reporting device not found:"
...@@ -486,7 +476,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) ...@@ -486,7 +476,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
/* Here we assume that we will never see multiple instances of this /* Here we assume that we will never see multiple instances of this
* type of memory controller. The ID is therefore hardcoded to 0. * type of memory controller. The ID is therefore hardcoded to 0.
*/ */
if (edac_mc_add_mc(mci,0)) { if (edac_mc_add_mc(mci, 0)) {
debugf3("%s(): failed edac_mc_add_mc()\n", __func__); debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
goto fail1; goto fail1;
} }
...@@ -495,10 +485,10 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) ...@@ -495,10 +485,10 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
debugf3("%s(): success\n", __func__); debugf3("%s(): success\n", __func__);
return 0; return 0;
fail1: fail1:
pci_dev_put(pvt->bridge_ck); pci_dev_put(pvt->bridge_ck);
fail0: fail0:
edac_mc_free(mci); edac_mc_free(mci);
return -ENODEV; return -ENODEV;
...@@ -525,7 +515,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev) ...@@ -525,7 +515,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
return; return;
pvt = (struct e7xxx_pvt *) mci->pvt_info; pvt = (struct e7xxx_pvt *)mci->pvt_info;
pci_dev_put(pvt->bridge_ck); pci_dev_put(pvt->bridge_ck);
edac_mc_free(mci); edac_mc_free(mci);
} }
...@@ -533,20 +523,16 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev) ...@@ -533,20 +523,16 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
static const struct pci_device_id e7xxx_pci_tbl[] __devinitdata = { static const struct pci_device_id e7xxx_pci_tbl[] __devinitdata = {
{ {
PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
E7205 E7205},
},
{ {
PCI_VEND_DEV(INTEL, 7500_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_VEND_DEV(INTEL, 7500_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
E7500 E7500},
},
{ {
PCI_VEND_DEV(INTEL, 7501_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_VEND_DEV(INTEL, 7501_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
E7501 E7501},
},
{ {
PCI_VEND_DEV(INTEL, 7505_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_VEND_DEV(INTEL, 7505_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
E7505 E7505},
},
{ {
0, 0,
} /* 0 terminated list. */ } /* 0 terminated list. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment