forked from Minki/linux
drivers/edac: Lindent e7xxx
Lindent cleanup of e7xxx_edac driver Signed-off-by: Dave Jiang <djiang@mvista.com> Signed-off-by: Douglas Thompson <dougthompson@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f4aff42653
commit
849a4c375a
@ -147,20 +147,16 @@ struct e7xxx_error_info {
|
||||
static const struct e7xxx_dev_info e7xxx_devs[] = {
|
||||
[E7500] = {
|
||||
.err_dev = PCI_DEVICE_ID_INTEL_7500_1_ERR,
|
||||
.ctl_name = "E7500"
|
||||
},
|
||||
.ctl_name = "E7500"},
|
||||
[E7501] = {
|
||||
.err_dev = PCI_DEVICE_ID_INTEL_7501_1_ERR,
|
||||
.ctl_name = "E7501"
|
||||
},
|
||||
.ctl_name = "E7501"},
|
||||
[E7505] = {
|
||||
.err_dev = PCI_DEVICE_ID_INTEL_7505_1_ERR,
|
||||
.ctl_name = "E7505"
|
||||
},
|
||||
.ctl_name = "E7505"},
|
||||
[E7205] = {
|
||||
.err_dev = PCI_DEVICE_ID_INTEL_7205_1_ERR,
|
||||
.ctl_name = "E7205"
|
||||
},
|
||||
.ctl_name = "E7205"},
|
||||
};
|
||||
|
||||
/* 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,
|
||||
unsigned long page)
|
||||
{
|
||||
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__);
|
||||
|
||||
@ -201,8 +197,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
|
||||
return pvt->tolm - 1;
|
||||
}
|
||||
|
||||
static void process_ce(struct mem_ctl_info *mci,
|
||||
struct e7xxx_error_info *info)
|
||||
static void process_ce(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
|
||||
{
|
||||
u32 error_1b, page;
|
||||
u16 syndrome;
|
||||
@ -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");
|
||||
}
|
||||
|
||||
static void process_ue(struct mem_ctl_info *mci,
|
||||
struct e7xxx_error_info *info)
|
||||
static void process_ue(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
|
||||
{
|
||||
u32 error_2b, block_page;
|
||||
int row;
|
||||
@ -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");
|
||||
}
|
||||
|
||||
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_pvt *pvt;
|
||||
|
||||
pvt = (struct e7xxx_pvt *) mci->pvt_info;
|
||||
pci_read_config_byte(pvt->bridge_ck, E7XXX_DRAM_FERR,
|
||||
&info->dram_ferr);
|
||||
pci_read_config_byte(pvt->bridge_ck, E7XXX_DRAM_NERR,
|
||||
&info->dram_nerr);
|
||||
pvt = (struct e7xxx_pvt *)mci->pvt_info;
|
||||
pci_read_config_byte(pvt->bridge_ck, E7XXX_DRAM_FERR, &info->dram_ferr);
|
||||
pci_read_config_byte(pvt->bridge_ck, E7XXX_DRAM_NERR, &info->dram_nerr);
|
||||
|
||||
if ((info->dram_ferr & 1) || (info->dram_nerr & 1)) {
|
||||
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,
|
||||
pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_NERR, 0x03, 0x03);
|
||||
}
|
||||
|
||||
static int e7xxx_process_error_info (struct mem_ctl_info *mci,
|
||||
struct e7xxx_error_info *info, int handle_errors)
|
||||
static int e7xxx_process_error_info(struct mem_ctl_info *mci,
|
||||
struct e7xxx_error_info *info,
|
||||
int handle_errors)
|
||||
{
|
||||
int error_found;
|
||||
|
||||
@ -342,7 +335,6 @@ static inline int dual_channel_active(u32 drc, int dev_idx)
|
||||
return (dev_idx == E7501) ? ((drc >> 22) & 0x1) : 1;
|
||||
}
|
||||
|
||||
|
||||
/* Return DRB granularity (0=32mb, 1=64mb). */
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
|
||||
int dev_idx, u32 drc)
|
||||
{
|
||||
@ -422,7 +413,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
|
||||
debugf0("%s(): mci\n", __func__);
|
||||
|
||||
/* make sure error reporting method is sane */
|
||||
switch(edac_op_state) {
|
||||
switch (edac_op_state) {
|
||||
case EDAC_OPSTATE_POLL:
|
||||
case EDAC_OPSTATE_NMI:
|
||||
break;
|
||||
@ -448,11 +439,10 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
|
||||
mci->mod_ver = E7XXX_REVISION;
|
||||
mci->dev = &pdev->dev;
|
||||
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->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
|
||||
pvt->dev_info->err_dev,
|
||||
pvt->bridge_ck);
|
||||
pvt->dev_info->err_dev, pvt->bridge_ck);
|
||||
|
||||
if (!pvt->bridge_ck) {
|
||||
e7xxx_printk(KERN_ERR, "error reporting device not found:"
|
||||
@ -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
|
||||
* 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__);
|
||||
goto fail1;
|
||||
}
|
||||
@ -495,10 +485,10 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
|
||||
debugf3("%s(): success\n", __func__);
|
||||
return 0;
|
||||
|
||||
fail1:
|
||||
fail1:
|
||||
pci_dev_put(pvt->bridge_ck);
|
||||
|
||||
fail0:
|
||||
fail0:
|
||||
edac_mc_free(mci);
|
||||
|
||||
return -ENODEV;
|
||||
@ -525,7 +515,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
|
||||
if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
|
||||
return;
|
||||
|
||||
pvt = (struct e7xxx_pvt *) mci->pvt_info;
|
||||
pvt = (struct e7xxx_pvt *)mci->pvt_info;
|
||||
pci_dev_put(pvt->bridge_ck);
|
||||
edac_mc_free(mci);
|
||||
}
|
||||
@ -533,20 +523,16 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
|
||||
static const struct pci_device_id e7xxx_pci_tbl[] __devinitdata = {
|
||||
{
|
||||
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,
|
||||
E7500
|
||||
},
|
||||
E7500},
|
||||
{
|
||||
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,
|
||||
E7505
|
||||
},
|
||||
E7505},
|
||||
{
|
||||
0,
|
||||
} /* 0 terminated list. */
|
||||
|
Loading…
Reference in New Issue
Block a user