diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-27 16:43:43 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-30 13:57:06 -0400 |
commit | 9c6f6b65d25aa7fe890377a92ea049c8e20da906 (patch) | |
tree | 317e9dfba3ff7307dc2c5ad0a9a98bf921cb551f /drivers | |
parent | d091a6eb177dd3da8f55f8fd73c5b80db0e1656f (diff) |
i7300-edac: CodingStyle cleanup
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/edac/i7300_edac.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c index a2a9ad499b6b..38920c0b5fbb 100644 --- a/drivers/edac/i7300_edac.c +++ b/drivers/edac/i7300_edac.c | |||
@@ -104,7 +104,7 @@ struct i7300_pvt { | |||
104 | 104 | ||
105 | u16 mir[MAX_MIR]; /* Memory Interleave Reg*/ | 105 | u16 mir[MAX_MIR]; /* Memory Interleave Reg*/ |
106 | 106 | ||
107 | u16 mtr[MAX_SLOTS][MAX_BRANCHES]; /* Memory Technlogy Reg */ | 107 | u16 mtr[MAX_SLOTS][MAX_BRANCHES]; /* Memory Technlogy Reg */ |
108 | u16 ambpresent[MAX_CHANNELS]; /* AMB present regs */ | 108 | u16 ambpresent[MAX_CHANNELS]; /* AMB present regs */ |
109 | 109 | ||
110 | /* DIMM information matrix, allocating architecture maximums */ | 110 | /* DIMM information matrix, allocating architecture maximums */ |
@@ -162,7 +162,7 @@ static struct edac_pci_ctl_info *i7300_pci; | |||
162 | #define AMBPRESENT_0 0x64 | 162 | #define AMBPRESENT_0 0x64 |
163 | #define AMBPRESENT_1 0x66 | 163 | #define AMBPRESENT_1 0x66 |
164 | 164 | ||
165 | const static u16 mtr_regs [MAX_SLOTS] = { | 165 | const static u16 mtr_regs[MAX_SLOTS] = { |
166 | 0x80, 0x84, 0x88, 0x8c, | 166 | 0x80, 0x84, 0x88, 0x8c, |
167 | 0x82, 0x86, 0x8a, 0x8e | 167 | 0x82, 0x86, 0x8a, 0x8e |
168 | }; | 168 | }; |
@@ -726,7 +726,7 @@ static void print_dimm_size(struct i7300_pvt *pvt) | |||
726 | p = pvt->tmp_prt_buffer; | 726 | p = pvt->tmp_prt_buffer; |
727 | space = PAGE_SIZE; | 727 | space = PAGE_SIZE; |
728 | n = snprintf(p, space, "-------------------------------" | 728 | n = snprintf(p, space, "-------------------------------" |
729 | "------------------------------"); | 729 | "------------------------------"); |
730 | p += n; | 730 | p += n; |
731 | space -= n; | 731 | space -= n; |
732 | debugf2("%s\n", pvt->tmp_prt_buffer); | 732 | debugf2("%s\n", pvt->tmp_prt_buffer); |
@@ -751,7 +751,7 @@ static void print_dimm_size(struct i7300_pvt *pvt) | |||
751 | } | 751 | } |
752 | 752 | ||
753 | n = snprintf(p, space, "-------------------------------" | 753 | n = snprintf(p, space, "-------------------------------" |
754 | "------------------------------"); | 754 | "------------------------------"); |
755 | p += n; | 755 | p += n; |
756 | space -= n; | 756 | space -= n; |
757 | debugf2("%s\n", pvt->tmp_prt_buffer); | 757 | debugf2("%s\n", pvt->tmp_prt_buffer); |
@@ -783,13 +783,15 @@ static int i7300_init_csrows(struct mem_ctl_info *mci) | |||
783 | for (branch = 0; branch < MAX_BRANCHES; branch++) { | 783 | for (branch = 0; branch < MAX_BRANCHES; branch++) { |
784 | /* Read and dump branch 0's MTRs */ | 784 | /* Read and dump branch 0's MTRs */ |
785 | channel = to_channel(0, branch); | 785 | channel = to_channel(0, branch); |
786 | pci_read_config_word(pvt->pci_dev_2x_0_fbd_branch[branch], AMBPRESENT_0, | 786 | pci_read_config_word(pvt->pci_dev_2x_0_fbd_branch[branch], |
787 | AMBPRESENT_0, | ||
787 | &pvt->ambpresent[channel]); | 788 | &pvt->ambpresent[channel]); |
788 | debugf2("\t\tAMB-present CH%d = 0x%x:\n", | 789 | debugf2("\t\tAMB-present CH%d = 0x%x:\n", |
789 | channel, pvt->ambpresent[channel]); | 790 | channel, pvt->ambpresent[channel]); |
790 | 791 | ||
791 | channel = to_channel(1, branch); | 792 | channel = to_channel(1, branch); |
792 | pci_read_config_word(pvt->pci_dev_2x_0_fbd_branch[branch], AMBPRESENT_1, | 793 | pci_read_config_word(pvt->pci_dev_2x_0_fbd_branch[branch], |
794 | AMBPRESENT_1, | ||
793 | &pvt->ambpresent[channel]); | 795 | &pvt->ambpresent[channel]); |
794 | debugf2("\t\tAMB-present CH%d = 0x%x:\n", | 796 | debugf2("\t\tAMB-present CH%d = 0x%x:\n", |
795 | channel, pvt->ambpresent[channel]); | 797 | channel, pvt->ambpresent[channel]); |
@@ -837,11 +839,12 @@ static int i7300_init_csrows(struct mem_ctl_info *mci) | |||
837 | static void decode_mir(int mir_no, u16 mir[MAX_MIR]) | 839 | static void decode_mir(int mir_no, u16 mir[MAX_MIR]) |
838 | { | 840 | { |
839 | if (mir[mir_no] & 3) | 841 | if (mir[mir_no] & 3) |
840 | debugf2("MIR%d: limit= 0x%x Branch(es) that participate: %s %s\n", | 842 | debugf2("MIR%d: limit= 0x%x Branch(es) that participate:" |
843 | " %s %s\n", | ||
841 | mir_no, | 844 | mir_no, |
842 | (mir[mir_no] >> 4) & 0xfff, | 845 | (mir[mir_no] >> 4) & 0xfff, |
843 | (mir[mir_no] & 1) ? "B0" : "", | 846 | (mir[mir_no] & 1) ? "B0" : "", |
844 | (mir[mir_no] & 2) ? "B1": ""); | 847 | (mir[mir_no] & 2) ? "B1" : ""); |
845 | } | 848 | } |
846 | 849 | ||
847 | /** | 850 | /** |
@@ -891,9 +894,12 @@ static int i7300_get_mc_regs(struct mem_ctl_info *mci) | |||
891 | IS_RETRY_ENABLED(pvt->mc_settings) ? "enabled" : "disabled"); | 894 | IS_RETRY_ENABLED(pvt->mc_settings) ? "enabled" : "disabled"); |
892 | 895 | ||
893 | /* Get Memory Interleave Range registers */ | 896 | /* Get Memory Interleave Range registers */ |
894 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR0, &pvt->mir[0]); | 897 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR0, |
895 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR1, &pvt->mir[1]); | 898 | &pvt->mir[0]); |
896 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR2, &pvt->mir[2]); | 899 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR1, |
900 | &pvt->mir[1]); | ||
901 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR2, | ||
902 | &pvt->mir[2]); | ||
897 | 903 | ||
898 | /* Decode the MIR regs */ | 904 | /* Decode the MIR regs */ |
899 | for (i = 0; i < MAX_MIR; i++) | 905 | for (i = 0; i < MAX_MIR; i++) |
@@ -952,7 +958,8 @@ static int __devinit i7300_get_devices(struct mem_ctl_info *mci) | |||
952 | 958 | ||
953 | /* Attempt to 'get' the MCH register we want */ | 959 | /* Attempt to 'get' the MCH register we want */ |
954 | pdev = NULL; | 960 | pdev = NULL; |
955 | while (!pvt->pci_dev_16_1_fsb_addr_map || !pvt->pci_dev_16_2_fsb_err_regs) { | 961 | while (!pvt->pci_dev_16_1_fsb_addr_map || |
962 | !pvt->pci_dev_16_2_fsb_err_regs) { | ||
956 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 963 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
957 | PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev); | 964 | PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev); |
958 | if (!pdev) { | 965 | if (!pdev) { |
@@ -980,16 +987,19 @@ static int __devinit i7300_get_devices(struct mem_ctl_info *mci) | |||
980 | 987 | ||
981 | debugf1("System Address, processor bus- PCI Bus ID: %s %x:%x\n", | 988 | debugf1("System Address, processor bus- PCI Bus ID: %s %x:%x\n", |
982 | pci_name(pvt->pci_dev_16_0_fsb_ctlr), | 989 | pci_name(pvt->pci_dev_16_0_fsb_ctlr), |
983 | pvt->pci_dev_16_0_fsb_ctlr->vendor, pvt->pci_dev_16_0_fsb_ctlr->device); | 990 | pvt->pci_dev_16_0_fsb_ctlr->vendor, |
991 | pvt->pci_dev_16_0_fsb_ctlr->device); | ||
984 | debugf1("Branchmap, control and errors - PCI Bus ID: %s %x:%x\n", | 992 | debugf1("Branchmap, control and errors - PCI Bus ID: %s %x:%x\n", |
985 | pci_name(pvt->pci_dev_16_1_fsb_addr_map), | 993 | pci_name(pvt->pci_dev_16_1_fsb_addr_map), |
986 | pvt->pci_dev_16_1_fsb_addr_map->vendor, pvt->pci_dev_16_1_fsb_addr_map->device); | 994 | pvt->pci_dev_16_1_fsb_addr_map->vendor, |
995 | pvt->pci_dev_16_1_fsb_addr_map->device); | ||
987 | debugf1("FSB Error Regs - PCI Bus ID: %s %x:%x\n", | 996 | debugf1("FSB Error Regs - PCI Bus ID: %s %x:%x\n", |
988 | pci_name(pvt->pci_dev_16_2_fsb_err_regs), | 997 | pci_name(pvt->pci_dev_16_2_fsb_err_regs), |
989 | pvt->pci_dev_16_2_fsb_err_regs->vendor, pvt->pci_dev_16_2_fsb_err_regs->device); | 998 | pvt->pci_dev_16_2_fsb_err_regs->vendor, |
999 | pvt->pci_dev_16_2_fsb_err_regs->device); | ||
990 | 1000 | ||
991 | pvt->pci_dev_2x_0_fbd_branch[0] = pci_get_device(PCI_VENDOR_ID_INTEL, | 1001 | pvt->pci_dev_2x_0_fbd_branch[0] = pci_get_device(PCI_VENDOR_ID_INTEL, |
992 | PCI_DEVICE_ID_INTEL_I7300_MCH_FB0, | 1002 | PCI_DEVICE_ID_INTEL_I7300_MCH_FB0, |
993 | NULL); | 1003 | NULL); |
994 | if (!pvt->pci_dev_2x_0_fbd_branch[0]) { | 1004 | if (!pvt->pci_dev_2x_0_fbd_branch[0]) { |
995 | i7300_printk(KERN_ERR, | 1005 | i7300_printk(KERN_ERR, |