diff options
author | Douglas Thompson <dougthompson@xmission.com> | 2007-07-19 04:50:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:55 -0400 |
commit | b2ccaecad2b00bf7bc72d5b864425daf43a4080d (patch) | |
tree | f682af7d48aecb8b888f1ea0b6b649e6f5be7caa | |
parent | f044091ca4c0b05be8f83748d76d4fbba4fc74cf (diff) |
drivers/edac: i5000 code tidying
Various code style conformance patches on the i5000 driver
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>
-rw-r--r-- | drivers/edac/i5000_edac.c | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c index b5a930884938..d68e8bad6f43 100644 --- a/drivers/edac/i5000_edac.c +++ b/drivers/edac/i5000_edac.c | |||
@@ -384,18 +384,18 @@ struct i5000_error_info { | |||
384 | 384 | ||
385 | static struct edac_pci_ctl_info *i5000_pci; | 385 | static struct edac_pci_ctl_info *i5000_pci; |
386 | 386 | ||
387 | /****************************************************************************** | 387 | /* |
388 | * i5000_get_error_info Retrieve the hardware error information from | 388 | * i5000_get_error_info Retrieve the hardware error information from |
389 | * the hardware and cache it in the 'info' | 389 | * the hardware and cache it in the 'info' |
390 | * structure | 390 | * structure |
391 | */ | 391 | */ |
392 | static void i5000_get_error_info(struct mem_ctl_info *mci, | 392 | static void i5000_get_error_info(struct mem_ctl_info *mci, |
393 | struct i5000_error_info * info) | 393 | struct i5000_error_info *info) |
394 | { | 394 | { |
395 | struct i5000_pvt *pvt; | 395 | struct i5000_pvt *pvt; |
396 | u32 value; | 396 | u32 value; |
397 | 397 | ||
398 | pvt = (struct i5000_pvt *)mci->pvt_info; | 398 | pvt = mci->pvt_info; |
399 | 399 | ||
400 | /* read in the 1st FATAL error register */ | 400 | /* read in the 1st FATAL error register */ |
401 | pci_read_config_dword(pvt->branchmap_werrors, FERR_FAT_FBD, &value); | 401 | pci_read_config_dword(pvt->branchmap_werrors, FERR_FAT_FBD, &value); |
@@ -457,7 +457,7 @@ static void i5000_get_error_info(struct mem_ctl_info *mci, | |||
457 | } | 457 | } |
458 | } | 458 | } |
459 | 459 | ||
460 | /****************************************************************************** | 460 | /* |
461 | * i5000_process_fatal_error_info(struct mem_ctl_info *mci, | 461 | * i5000_process_fatal_error_info(struct mem_ctl_info *mci, |
462 | * struct i5000_error_info *info, | 462 | * struct i5000_error_info *info, |
463 | * int handle_errors); | 463 | * int handle_errors); |
@@ -465,7 +465,7 @@ static void i5000_get_error_info(struct mem_ctl_info *mci, | |||
465 | * handle the Intel FATAL errors, if any | 465 | * handle the Intel FATAL errors, if any |
466 | */ | 466 | */ |
467 | static void i5000_process_fatal_error_info(struct mem_ctl_info *mci, | 467 | static void i5000_process_fatal_error_info(struct mem_ctl_info *mci, |
468 | struct i5000_error_info * info, | 468 | struct i5000_error_info *info, |
469 | int handle_errors) | 469 | int handle_errors) |
470 | { | 470 | { |
471 | char msg[EDAC_MC_LABEL_LEN + 1 + 90]; | 471 | char msg[EDAC_MC_LABEL_LEN + 1 + 90]; |
@@ -530,7 +530,7 @@ static void i5000_process_fatal_error_info(struct mem_ctl_info *mci, | |||
530 | edac_mc_handle_fbd_ue(mci, rank, channel, channel + 1, msg); | 530 | edac_mc_handle_fbd_ue(mci, rank, channel, channel + 1, msg); |
531 | } | 531 | } |
532 | 532 | ||
533 | /****************************************************************************** | 533 | /* |
534 | * i5000_process_fatal_error_info(struct mem_ctl_info *mci, | 534 | * i5000_process_fatal_error_info(struct mem_ctl_info *mci, |
535 | * struct i5000_error_info *info, | 535 | * struct i5000_error_info *info, |
536 | * int handle_errors); | 536 | * int handle_errors); |
@@ -538,7 +538,7 @@ static void i5000_process_fatal_error_info(struct mem_ctl_info *mci, | |||
538 | * handle the Intel NON-FATAL errors, if any | 538 | * handle the Intel NON-FATAL errors, if any |
539 | */ | 539 | */ |
540 | static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci, | 540 | static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci, |
541 | struct i5000_error_info * info, | 541 | struct i5000_error_info *info, |
542 | int handle_errors) | 542 | int handle_errors) |
543 | { | 543 | { |
544 | char msg[EDAC_MC_LABEL_LEN + 1 + 90]; | 544 | char msg[EDAC_MC_LABEL_LEN + 1 + 90]; |
@@ -666,12 +666,12 @@ static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci, | |||
666 | } | 666 | } |
667 | } | 667 | } |
668 | 668 | ||
669 | /****************************************************************************** | 669 | /* |
670 | * i5000_process_error_info Process the error info that is | 670 | * i5000_process_error_info Process the error info that is |
671 | * in the 'info' structure, previously retrieved from hardware | 671 | * in the 'info' structure, previously retrieved from hardware |
672 | */ | 672 | */ |
673 | static void i5000_process_error_info(struct mem_ctl_info *mci, | 673 | static void i5000_process_error_info(struct mem_ctl_info *mci, |
674 | struct i5000_error_info * info, | 674 | struct i5000_error_info *info, |
675 | int handle_errors) | 675 | int handle_errors) |
676 | { | 676 | { |
677 | /* First handle any fatal errors that occurred */ | 677 | /* First handle any fatal errors that occurred */ |
@@ -681,7 +681,7 @@ static void i5000_process_error_info(struct mem_ctl_info *mci, | |||
681 | i5000_process_nonfatal_error_info(mci, info, handle_errors); | 681 | i5000_process_nonfatal_error_info(mci, info, handle_errors); |
682 | } | 682 | } |
683 | 683 | ||
684 | /****************************************************************************** | 684 | /* |
685 | * i5000_clear_error Retrieve any error from the hardware | 685 | * i5000_clear_error Retrieve any error from the hardware |
686 | * but do NOT process that error. | 686 | * but do NOT process that error. |
687 | * Used for 'clearing' out of previous errors | 687 | * Used for 'clearing' out of previous errors |
@@ -694,7 +694,7 @@ static void i5000_clear_error(struct mem_ctl_info *mci) | |||
694 | i5000_get_error_info(mci, &info); | 694 | i5000_get_error_info(mci, &info); |
695 | } | 695 | } |
696 | 696 | ||
697 | /****************************************************************************** | 697 | /* |
698 | * i5000_check_error Retrieve and process errors reported by the | 698 | * i5000_check_error Retrieve and process errors reported by the |
699 | * hardware. Called by the Core module. | 699 | * hardware. Called by the Core module. |
700 | */ | 700 | */ |
@@ -706,7 +706,7 @@ static void i5000_check_error(struct mem_ctl_info *mci) | |||
706 | i5000_process_error_info(mci, &info, 1); | 706 | i5000_process_error_info(mci, &info, 1); |
707 | } | 707 | } |
708 | 708 | ||
709 | /****************************************************************************** | 709 | /* |
710 | * i5000_get_devices Find and perform 'get' operation on the MCH's | 710 | * i5000_get_devices Find and perform 'get' operation on the MCH's |
711 | * device/functions we want to reference for this driver | 711 | * device/functions we want to reference for this driver |
712 | * | 712 | * |
@@ -718,7 +718,7 @@ static int i5000_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
718 | struct i5000_pvt *pvt; | 718 | struct i5000_pvt *pvt; |
719 | struct pci_dev *pdev; | 719 | struct pci_dev *pdev; |
720 | 720 | ||
721 | pvt = (struct i5000_pvt *)mci->pvt_info; | 721 | pvt = mci->pvt_info; |
722 | 722 | ||
723 | /* Attempt to 'get' the MCH register we want */ | 723 | /* Attempt to 'get' the MCH register we want */ |
724 | pdev = NULL; | 724 | pdev = NULL; |
@@ -827,7 +827,7 @@ static int i5000_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
827 | return 0; | 827 | return 0; |
828 | } | 828 | } |
829 | 829 | ||
830 | /****************************************************************************** | 830 | /* |
831 | * i5000_put_devices 'put' all the devices that we have | 831 | * i5000_put_devices 'put' all the devices that we have |
832 | * reserved via 'get' | 832 | * reserved via 'get' |
833 | */ | 833 | */ |
@@ -835,19 +835,18 @@ static void i5000_put_devices(struct mem_ctl_info *mci) | |||
835 | { | 835 | { |
836 | struct i5000_pvt *pvt; | 836 | struct i5000_pvt *pvt; |
837 | 837 | ||
838 | pvt = (struct i5000_pvt *)mci->pvt_info; | 838 | pvt = mci->pvt_info; |
839 | 839 | ||
840 | pci_dev_put(pvt->branchmap_werrors); /* FUNC 1 */ | 840 | pci_dev_put(pvt->branchmap_werrors); /* FUNC 1 */ |
841 | pci_dev_put(pvt->fsb_error_regs); /* FUNC 2 */ | 841 | pci_dev_put(pvt->fsb_error_regs); /* FUNC 2 */ |
842 | pci_dev_put(pvt->branch_0); /* DEV 21 */ | 842 | pci_dev_put(pvt->branch_0); /* DEV 21 */ |
843 | 843 | ||
844 | /* Only if more than 2 channels do we release the second branch */ | 844 | /* Only if more than 2 channels do we release the second branch */ |
845 | if (pvt->maxch >= CHANNELS_PER_BRANCH) { | 845 | if (pvt->maxch >= CHANNELS_PER_BRANCH) |
846 | pci_dev_put(pvt->branch_1); /* DEV 22 */ | 846 | pci_dev_put(pvt->branch_1); /* DEV 22 */ |
847 | } | ||
848 | } | 847 | } |
849 | 848 | ||
850 | /****************************************************************************** | 849 | /* |
851 | * determine_amb_resent | 850 | * determine_amb_resent |
852 | * | 851 | * |
853 | * the information is contained in NUM_MTRS different registers | 852 | * the information is contained in NUM_MTRS different registers |
@@ -879,7 +878,7 @@ static int determine_amb_present_reg(struct i5000_pvt *pvt, int channel) | |||
879 | return amb_present; | 878 | return amb_present; |
880 | } | 879 | } |
881 | 880 | ||
882 | /****************************************************************************** | 881 | /* |
883 | * determine_mtr(pvt, csrow, channel) | 882 | * determine_mtr(pvt, csrow, channel) |
884 | * | 883 | * |
885 | * return the proper MTR register as determine by the csrow and channel desired | 884 | * return the proper MTR register as determine by the csrow and channel desired |
@@ -896,7 +895,7 @@ static int determine_mtr(struct i5000_pvt *pvt, int csrow, int channel) | |||
896 | return mtr; | 895 | return mtr; |
897 | } | 896 | } |
898 | 897 | ||
899 | /****************************************************************************** | 898 | /* |
900 | */ | 899 | */ |
901 | static void decode_mtr(int slot_row, u16 mtr) | 900 | static void decode_mtr(int slot_row, u16 mtr) |
902 | { | 901 | { |
@@ -951,7 +950,7 @@ static void handle_channel(struct i5000_pvt *pvt, int csrow, int channel, | |||
951 | } | 950 | } |
952 | } | 951 | } |
953 | 952 | ||
954 | /****************************************************************************** | 953 | /* |
955 | * calculate_dimm_size | 954 | * calculate_dimm_size |
956 | * | 955 | * |
957 | * also will output a DIMM matrix map, if debug is enabled, for viewing | 956 | * also will output a DIMM matrix map, if debug is enabled, for viewing |
@@ -1037,7 +1036,7 @@ static void calculate_dimm_size(struct i5000_pvt *pvt) | |||
1037 | kfree(mem_buffer); | 1036 | kfree(mem_buffer); |
1038 | } | 1037 | } |
1039 | 1038 | ||
1040 | /****************************************************************************** | 1039 | /* |
1041 | * i5000_get_mc_regs read in the necessary registers and | 1040 | * i5000_get_mc_regs read in the necessary registers and |
1042 | * cache locally | 1041 | * cache locally |
1043 | * | 1042 | * |
@@ -1053,7 +1052,7 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci) | |||
1053 | int maxdimmperch; | 1052 | int maxdimmperch; |
1054 | int way0, way1; | 1053 | int way0, way1; |
1055 | 1054 | ||
1056 | pvt = (struct i5000_pvt *)mci->pvt_info; | 1055 | pvt = mci->pvt_info; |
1057 | 1056 | ||
1058 | pci_read_config_dword(pvt->system_address, AMBASE, | 1057 | pci_read_config_dword(pvt->system_address, AMBASE, |
1059 | (u32 *) & pvt->ambase); | 1058 | (u32 *) & pvt->ambase); |
@@ -1151,7 +1150,7 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci) | |||
1151 | calculate_dimm_size(pvt); | 1150 | calculate_dimm_size(pvt); |
1152 | } | 1151 | } |
1153 | 1152 | ||
1154 | /****************************************************************************** | 1153 | /* |
1155 | * i5000_init_csrows Initialize the 'csrows' table within | 1154 | * i5000_init_csrows Initialize the 'csrows' table within |
1156 | * the mci control structure with the | 1155 | * the mci control structure with the |
1157 | * addressing of memory. | 1156 | * addressing of memory. |
@@ -1171,7 +1170,7 @@ static int i5000_init_csrows(struct mem_ctl_info *mci) | |||
1171 | int channel; | 1170 | int channel; |
1172 | int csrow; | 1171 | int csrow; |
1173 | 1172 | ||
1174 | pvt = (struct i5000_pvt *)mci->pvt_info; | 1173 | pvt = mci->pvt_info; |
1175 | 1174 | ||
1176 | channel_count = pvt->maxch; | 1175 | channel_count = pvt->maxch; |
1177 | max_csrows = pvt->maxdimmperch * 2; | 1176 | max_csrows = pvt->maxdimmperch * 2; |
@@ -1221,7 +1220,7 @@ static int i5000_init_csrows(struct mem_ctl_info *mci) | |||
1221 | return empty; | 1220 | return empty; |
1222 | } | 1221 | } |
1223 | 1222 | ||
1224 | /****************************************************************************** | 1223 | /* |
1225 | * i5000_enable_error_reporting | 1224 | * i5000_enable_error_reporting |
1226 | * Turn on the memory reporting features of the hardware | 1225 | * Turn on the memory reporting features of the hardware |
1227 | */ | 1226 | */ |
@@ -1230,7 +1229,7 @@ static void i5000_enable_error_reporting(struct mem_ctl_info *mci) | |||
1230 | struct i5000_pvt *pvt; | 1229 | struct i5000_pvt *pvt; |
1231 | u32 fbd_error_mask; | 1230 | u32 fbd_error_mask; |
1232 | 1231 | ||
1233 | pvt = (struct i5000_pvt *)mci->pvt_info; | 1232 | pvt = mci->pvt_info; |
1234 | 1233 | ||
1235 | /* Read the FBD Error Mask Register */ | 1234 | /* Read the FBD Error Mask Register */ |
1236 | pci_read_config_dword(pvt->branchmap_werrors, EMASK_FBD, | 1235 | pci_read_config_dword(pvt->branchmap_werrors, EMASK_FBD, |
@@ -1243,7 +1242,7 @@ static void i5000_enable_error_reporting(struct mem_ctl_info *mci) | |||
1243 | fbd_error_mask); | 1242 | fbd_error_mask); |
1244 | } | 1243 | } |
1245 | 1244 | ||
1246 | /****************************************************************************** | 1245 | /* |
1247 | * i5000_get_dimm_and_channel_counts(pdev, &num_csrows, &num_channels) | 1246 | * i5000_get_dimm_and_channel_counts(pdev, &num_csrows, &num_channels) |
1248 | * | 1247 | * |
1249 | * ask the device how many channels are present and how many CSROWS | 1248 | * ask the device how many channels are present and how many CSROWS |
@@ -1265,7 +1264,7 @@ static void i5000_get_dimm_and_channel_counts(struct pci_dev *pdev, | |||
1265 | *num_channels = (int)value; | 1264 | *num_channels = (int)value; |
1266 | } | 1265 | } |
1267 | 1266 | ||
1268 | /****************************************************************************** | 1267 | /* |
1269 | * i5000_probe1 Probe for ONE instance of device to see if it is | 1268 | * i5000_probe1 Probe for ONE instance of device to see if it is |
1270 | * present. | 1269 | * present. |
1271 | * return: | 1270 | * return: |
@@ -1329,7 +1328,7 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx) | |||
1329 | 1328 | ||
1330 | mci->dev = &pdev->dev; /* record ptr to the generic device */ | 1329 | mci->dev = &pdev->dev; /* record ptr to the generic device */ |
1331 | 1330 | ||
1332 | pvt = (struct i5000_pvt *)mci->pvt_info; | 1331 | pvt = mci->pvt_info; |
1333 | pvt->system_address = pdev; /* Record this device in our private */ | 1332 | pvt->system_address = pdev; /* Record this device in our private */ |
1334 | pvt->maxch = num_channels; | 1333 | pvt->maxch = num_channels; |
1335 | pvt->maxdimmperch = num_dimms_per_channel; | 1334 | pvt->maxdimmperch = num_dimms_per_channel; |
@@ -1401,7 +1400,7 @@ fail0: | |||
1401 | return -ENODEV; | 1400 | return -ENODEV; |
1402 | } | 1401 | } |
1403 | 1402 | ||
1404 | /****************************************************************************** | 1403 | /* |
1405 | * i5000_init_one constructor for one instance of device | 1404 | * i5000_init_one constructor for one instance of device |
1406 | * | 1405 | * |
1407 | * returns: | 1406 | * returns: |
@@ -1424,7 +1423,7 @@ static int __devinit i5000_init_one(struct pci_dev *pdev, | |||
1424 | return i5000_probe1(pdev, id->driver_data); | 1423 | return i5000_probe1(pdev, id->driver_data); |
1425 | } | 1424 | } |
1426 | 1425 | ||
1427 | /************************************************************************** | 1426 | /* |
1428 | * i5000_remove_one destructor for one instance of device | 1427 | * i5000_remove_one destructor for one instance of device |
1429 | * | 1428 | * |
1430 | */ | 1429 | */ |
@@ -1446,7 +1445,7 @@ static void __devexit i5000_remove_one(struct pci_dev *pdev) | |||
1446 | edac_mc_free(mci); | 1445 | edac_mc_free(mci); |
1447 | } | 1446 | } |
1448 | 1447 | ||
1449 | /************************************************************************** | 1448 | /* |
1450 | * pci_device_id table for which devices we are looking for | 1449 | * pci_device_id table for which devices we are looking for |
1451 | * | 1450 | * |
1452 | * The "E500P" device is the first device supported. | 1451 | * The "E500P" device is the first device supported. |
@@ -1460,7 +1459,7 @@ static const struct pci_device_id i5000_pci_tbl[] __devinitdata = { | |||
1460 | 1459 | ||
1461 | MODULE_DEVICE_TABLE(pci, i5000_pci_tbl); | 1460 | MODULE_DEVICE_TABLE(pci, i5000_pci_tbl); |
1462 | 1461 | ||
1463 | /************************************************************************** | 1462 | /* |
1464 | * i5000_driver pci_driver structure for this module | 1463 | * i5000_driver pci_driver structure for this module |
1465 | * | 1464 | * |
1466 | */ | 1465 | */ |
@@ -1471,7 +1470,7 @@ static struct pci_driver i5000_driver = { | |||
1471 | .id_table = i5000_pci_tbl, | 1470 | .id_table = i5000_pci_tbl, |
1472 | }; | 1471 | }; |
1473 | 1472 | ||
1474 | /************************************************************************** | 1473 | /* |
1475 | * i5000_init Module entry function | 1474 | * i5000_init Module entry function |
1476 | * Try to initialize this module for its devices | 1475 | * Try to initialize this module for its devices |
1477 | */ | 1476 | */ |
@@ -1486,7 +1485,7 @@ static int __init i5000_init(void) | |||
1486 | return (pci_rc < 0) ? pci_rc : 0; | 1485 | return (pci_rc < 0) ? pci_rc : 0; |
1487 | } | 1486 | } |
1488 | 1487 | ||
1489 | /************************************************************************** | 1488 | /* |
1490 | * i5000_exit() Module exit function | 1489 | * i5000_exit() Module exit function |
1491 | * Unregister the driver | 1490 | * Unregister the driver |
1492 | */ | 1491 | */ |