diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-04-29 04:03:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:26 -0400 |
commit | 1a45027d1afd7e85254b5ef8535e93ce3d588cf4 (patch) | |
tree | 20fae852bbb0f352ed787ed283581e5311a66319 /drivers/edac | |
parent | ff6ac2a616c85d1215899ffda815e29b699cbd3a (diff) |
edac: remove unneeded functions and add static accessor
Collection of patches, merged into one, from Adrian that do the following:
1) This patch makes the following needlessly global functions static:
- edac_pci_get_log_pe()
- edac_pci_get_log_npe()
- edac_pci_get_panic_on_pe()
- edac_pci_unregister_sysfs_instance_kobj()
- edac_pci_main_kobj_setup()
2) Remove unneeded function edac_device_find()
3) Added #if 0 around function edac_pci_find()
4) make the needlessly global edac_pci_generic_check() static
5) Removed function edac_check_mc_devices()
Doug Thompson modified Adrian's patches, to bettern represent
the direction of EDAC, and make them one patch.
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/edac_device.c | 31 | ||||
-rw-r--r-- | drivers/edac/edac_mc.c | 21 | ||||
-rw-r--r-- | drivers/edac/edac_module.h | 1 | ||||
-rw-r--r-- | drivers/edac/edac_pci.c | 6 | ||||
-rw-r--r-- | drivers/edac/edac_pci_sysfs.c | 11 |
5 files changed, 11 insertions, 59 deletions
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index c559bf543422..63372fa7ecfe 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c | |||
@@ -375,37 +375,6 @@ static void del_edac_device_from_global_list(struct edac_device_ctl_info | |||
375 | wait_for_completion(&edac_device->removal_complete); | 375 | wait_for_completion(&edac_device->removal_complete); |
376 | } | 376 | } |
377 | 377 | ||
378 | /** | ||
379 | * edac_device_find | ||
380 | * Search for a edac_device_ctl_info structure whose index is 'idx'. | ||
381 | * | ||
382 | * If found, return a pointer to the structure. | ||
383 | * Else return NULL. | ||
384 | * | ||
385 | * Caller must hold device_ctls_mutex. | ||
386 | */ | ||
387 | struct edac_device_ctl_info *edac_device_find(int idx) | ||
388 | { | ||
389 | struct list_head *item; | ||
390 | struct edac_device_ctl_info *edac_dev; | ||
391 | |||
392 | /* Iterate over list, looking for exact match of ID */ | ||
393 | list_for_each(item, &edac_device_list) { | ||
394 | edac_dev = list_entry(item, struct edac_device_ctl_info, link); | ||
395 | |||
396 | if (edac_dev->dev_idx >= idx) { | ||
397 | if (edac_dev->dev_idx == idx) | ||
398 | return edac_dev; | ||
399 | |||
400 | /* not on list, so terminate early */ | ||
401 | break; | ||
402 | } | ||
403 | } | ||
404 | |||
405 | return NULL; | ||
406 | } | ||
407 | EXPORT_SYMBOL_GPL(edac_device_find); | ||
408 | |||
409 | /* | 378 | /* |
410 | * edac_device_workq_function | 379 | * edac_device_workq_function |
411 | * performs the operation scheduled by a workq request | 380 | * performs the operation scheduled by a workq request |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 9cd778f920a4..a4cf1645f588 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -886,24 +886,3 @@ void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci, | |||
886 | mci->csrows[csrow].channels[channel].ce_count++; | 886 | mci->csrows[csrow].channels[channel].ce_count++; |
887 | } | 887 | } |
888 | EXPORT_SYMBOL(edac_mc_handle_fbd_ce); | 888 | EXPORT_SYMBOL(edac_mc_handle_fbd_ce); |
889 | |||
890 | /* | ||
891 | * Iterate over all MC instances and check for ECC, et al, errors | ||
892 | */ | ||
893 | void edac_check_mc_devices(void) | ||
894 | { | ||
895 | struct list_head *item; | ||
896 | struct mem_ctl_info *mci; | ||
897 | |||
898 | debugf3("%s()\n", __func__); | ||
899 | mutex_lock(&mem_ctls_mutex); | ||
900 | |||
901 | list_for_each(item, &mc_devices) { | ||
902 | mci = list_entry(item, struct mem_ctl_info, link); | ||
903 | |||
904 | if (mci->edac_check != NULL) | ||
905 | mci->edac_check(mci); | ||
906 | } | ||
907 | |||
908 | mutex_unlock(&mem_ctls_mutex); | ||
909 | } | ||
diff --git a/drivers/edac/edac_module.h b/drivers/edac/edac_module.h index cbc419c8ebc1..233d4798c3aa 100644 --- a/drivers/edac/edac_module.h +++ b/drivers/edac/edac_module.h | |||
@@ -27,7 +27,6 @@ extern int edac_mc_register_sysfs_main_kobj(struct mem_ctl_info *mci); | |||
27 | extern void edac_mc_unregister_sysfs_main_kobj(struct mem_ctl_info *mci); | 27 | extern void edac_mc_unregister_sysfs_main_kobj(struct mem_ctl_info *mci); |
28 | extern int edac_create_sysfs_mci_device(struct mem_ctl_info *mci); | 28 | extern int edac_create_sysfs_mci_device(struct mem_ctl_info *mci); |
29 | extern void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci); | 29 | extern void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci); |
30 | extern void edac_check_mc_devices(void); | ||
31 | extern int edac_get_log_ue(void); | 30 | extern int edac_get_log_ue(void); |
32 | extern int edac_get_log_ce(void); | 31 | extern int edac_get_log_ce(void); |
33 | extern int edac_get_panic_on_ue(void); | 32 | extern int edac_get_panic_on_ue(void); |
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index 2d4176c3133e..9b24340b52e1 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c | |||
@@ -189,6 +189,9 @@ static void del_edac_pci_from_global_list(struct edac_pci_ctl_info *pci) | |||
189 | wait_for_completion(&pci->complete); | 189 | wait_for_completion(&pci->complete); |
190 | } | 190 | } |
191 | 191 | ||
192 | #if 0 | ||
193 | /* Older code, but might use in the future */ | ||
194 | |||
192 | /* | 195 | /* |
193 | * edac_pci_find() | 196 | * edac_pci_find() |
194 | * Search for an edac_pci_ctl_info structure whose index is 'idx' | 197 | * Search for an edac_pci_ctl_info structure whose index is 'idx' |
@@ -219,6 +222,7 @@ struct edac_pci_ctl_info *edac_pci_find(int idx) | |||
219 | return NULL; | 222 | return NULL; |
220 | } | 223 | } |
221 | EXPORT_SYMBOL_GPL(edac_pci_find); | 224 | EXPORT_SYMBOL_GPL(edac_pci_find); |
225 | #endif | ||
222 | 226 | ||
223 | /* | 227 | /* |
224 | * edac_pci_workq_function() | 228 | * edac_pci_workq_function() |
@@ -422,7 +426,7 @@ EXPORT_SYMBOL_GPL(edac_pci_del_device); | |||
422 | * | 426 | * |
423 | * a Generic parity check API | 427 | * a Generic parity check API |
424 | */ | 428 | */ |
425 | void edac_pci_generic_check(struct edac_pci_ctl_info *pci) | 429 | static void edac_pci_generic_check(struct edac_pci_ctl_info *pci) |
426 | { | 430 | { |
427 | debugf4("%s()\n", __func__); | 431 | debugf4("%s()\n", __func__); |
428 | edac_pci_do_parity_check(); | 432 | edac_pci_do_parity_check(); |
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c index 71c3195d3704..2c1fa1bb6df2 100644 --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c | |||
@@ -37,17 +37,17 @@ int edac_pci_get_check_errors(void) | |||
37 | return check_pci_errors; | 37 | return check_pci_errors; |
38 | } | 38 | } |
39 | 39 | ||
40 | int edac_pci_get_log_pe(void) | 40 | static int edac_pci_get_log_pe(void) |
41 | { | 41 | { |
42 | return edac_pci_log_pe; | 42 | return edac_pci_log_pe; |
43 | } | 43 | } |
44 | 44 | ||
45 | int edac_pci_get_log_npe(void) | 45 | static int edac_pci_get_log_npe(void) |
46 | { | 46 | { |
47 | return edac_pci_log_npe; | 47 | return edac_pci_log_npe; |
48 | } | 48 | } |
49 | 49 | ||
50 | int edac_pci_get_panic_on_pe(void) | 50 | static int edac_pci_get_panic_on_pe(void) |
51 | { | 51 | { |
52 | return edac_pci_panic_on_pe; | 52 | return edac_pci_panic_on_pe; |
53 | } | 53 | } |
@@ -197,7 +197,8 @@ error_out: | |||
197 | * | 197 | * |
198 | * unregister the kobj for the EDAC PCI instance | 198 | * unregister the kobj for the EDAC PCI instance |
199 | */ | 199 | */ |
200 | void edac_pci_unregister_sysfs_instance_kobj(struct edac_pci_ctl_info *pci) | 200 | static void edac_pci_unregister_sysfs_instance_kobj( |
201 | struct edac_pci_ctl_info *pci) | ||
201 | { | 202 | { |
202 | debugf0("%s()\n", __func__); | 203 | debugf0("%s()\n", __func__); |
203 | 204 | ||
@@ -337,7 +338,7 @@ static struct kobj_type ktype_edac_pci_main_kobj = { | |||
337 | * setup the sysfs for EDAC PCI attributes | 338 | * setup the sysfs for EDAC PCI attributes |
338 | * assumes edac_class has already been initialized | 339 | * assumes edac_class has already been initialized |
339 | */ | 340 | */ |
340 | int edac_pci_main_kobj_setup(void) | 341 | static int edac_pci_main_kobj_setup(void) |
341 | { | 342 | { |
342 | int err; | 343 | int err; |
343 | struct sysdev_class *edac_class; | 344 | struct sysdev_class *edac_class; |