Commit 079708b9 authored by Douglas Thompson's avatar Douglas Thompson Committed by Linus Torvalds

drivers/edac: core Lindent cleanup

Run the EDAC CORE files through Lindent for cleanup
Signed-off-by: default avatarDouglas Thompson <dougthompson@xmission.com>
Signed-off-by: default avatarDave Jiang <djiang@mvista.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4de78c68
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* /*
* Older .h file for edac, until all drivers are modified * Older .h file for edac, until all drivers are modified
* *
*/ */
#include "edac_core.h" #include "edac_core.h"
This diff is collapsed.
...@@ -37,7 +37,7 @@ static int edac_class_valid = 0; ...@@ -37,7 +37,7 @@ static int edac_class_valid = 0;
/* /*
* edac_op_state_toString() * edac_op_state_toString()
*/ */
char * edac_op_state_toString(int opstate) char *edac_op_state_toString(int opstate)
{ {
if (opstate == OP_RUNNING_POLL) if (opstate == OP_RUNNING_POLL)
return "POLLED"; return "POLLED";
...@@ -60,7 +60,7 @@ char * edac_op_state_toString(int opstate) ...@@ -60,7 +60,7 @@ char * edac_op_state_toString(int opstate)
*/ */
struct sysdev_class *edac_get_edac_class(void) struct sysdev_class *edac_get_edac_class(void)
{ {
struct sysdev_class *classptr=NULL; struct sysdev_class *classptr = NULL;
if (edac_class_valid) if (edac_class_valid)
classptr = &edac_class; classptr = &edac_class;
...@@ -133,7 +133,6 @@ static void edac_workqueue_teardown(void) ...@@ -133,7 +133,6 @@ static void edac_workqueue_teardown(void)
} }
} }
/* /*
* edac_init * edac_init
* module initialization entry point * module initialization entry point
...@@ -148,8 +147,8 @@ static int __init edac_init(void) ...@@ -148,8 +147,8 @@ static int __init edac_init(void)
* Harvest and clear any boot/initialization PCI parity errors * Harvest and clear any boot/initialization PCI parity errors
* *
* FIXME: This only clears errors logged by devices present at time of * FIXME: This only clears errors logged by devices present at time of
* module initialization. We should also do an initial clear * module initialization. We should also do an initial clear
* of each newly hotplugged device. * of each newly hotplugged device.
*/ */
edac_pci_clear_parity_errors(); edac_pci_clear_parity_errors();
...@@ -158,7 +157,7 @@ static int __init edac_init(void) ...@@ -158,7 +157,7 @@ static int __init edac_init(void)
*/ */
if (edac_register_sysfs_edac_name()) { if (edac_register_sysfs_edac_name()) {
edac_printk(KERN_ERR, EDAC_MC, edac_printk(KERN_ERR, EDAC_MC,
"Error initializing 'edac' kobject\n"); "Error initializing 'edac' kobject\n");
err = -ENODEV; err = -ENODEV;
goto error; goto error;
} }
...@@ -167,7 +166,7 @@ static int __init edac_init(void) ...@@ -167,7 +166,7 @@ static int __init edac_init(void)
*/ */
if (edac_sysfs_memctrl_setup()) { if (edac_sysfs_memctrl_setup()) {
edac_printk(KERN_ERR, EDAC_MC, edac_printk(KERN_ERR, EDAC_MC,
"Error initializing sysfs code\n"); "Error initializing sysfs code\n");
err = -ENODEV; err = -ENODEV;
goto error_sysfs; goto error_sysfs;
} }
...@@ -182,11 +181,11 @@ static int __init edac_init(void) ...@@ -182,11 +181,11 @@ static int __init edac_init(void)
return 0; return 0;
/* Error teardown stack */ /* Error teardown stack */
error_mem: error_mem:
edac_sysfs_memctrl_teardown(); edac_sysfs_memctrl_teardown();
error_sysfs: error_sysfs:
edac_unregister_sysfs_edac_name(); edac_unregister_sysfs_edac_name();
error: error:
return err; return err;
} }
...@@ -198,7 +197,7 @@ static void __exit edac_exit(void) ...@@ -198,7 +197,7 @@ static void __exit edac_exit(void)
{ {
debugf0("%s()\n", __func__); debugf0("%s()\n", __func__);
/* tear down the various subsystems*/ /* tear down the various subsystems */
edac_workqueue_teardown(); edac_workqueue_teardown();
edac_sysfs_memctrl_teardown(); edac_sysfs_memctrl_teardown();
edac_unregister_sysfs_edac_name(); edac_unregister_sysfs_edac_name();
...@@ -220,4 +219,3 @@ MODULE_DESCRIPTION("Core library routines for EDAC reporting"); ...@@ -220,4 +219,3 @@ MODULE_DESCRIPTION("Core library routines for EDAC reporting");
module_param(edac_debug_level, int, 0644); module_param(edac_debug_level, int, 0644);
MODULE_PARM_DESC(edac_debug_level, "Debug level"); MODULE_PARM_DESC(edac_debug_level, "Debug level");
#endif #endif
...@@ -40,12 +40,10 @@ extern struct sysdev_class *edac_get_edac_class(void); ...@@ -40,12 +40,10 @@ extern struct sysdev_class *edac_get_edac_class(void);
/* edac core workqueue: single CPU mode */ /* edac core workqueue: single CPU mode */
extern struct workqueue_struct *edac_workqueue; extern struct workqueue_struct *edac_workqueue;
extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
unsigned msec); unsigned msec);
extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev); extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev);
extern void edac_device_reset_delay_period( extern void edac_device_reset_delay_period(struct edac_device_ctl_info
struct edac_device_ctl_info *edac_dev, *edac_dev, unsigned long value);
unsigned long value);
/* /*
* EDAC PCI functions * EDAC PCI functions
...@@ -57,7 +55,7 @@ extern int edac_sysfs_pci_setup(void); ...@@ -57,7 +55,7 @@ extern int edac_sysfs_pci_setup(void);
extern void edac_sysfs_pci_teardown(void); extern void edac_sysfs_pci_teardown(void);
extern int edac_pci_get_check_errors(void); extern int edac_pci_get_check_errors(void);
extern int edac_pci_get_poll_msec(void); extern int edac_pci_get_poll_msec(void);
#else /* CONFIG_PCI */ #else /* CONFIG_PCI */
/* pre-process these away */ /* pre-process these away */
#define edac_pci_do_parity_check() #define edac_pci_do_parity_check()
#define edac_pci_clear_parity_errors() #define edac_pci_clear_parity_errors()
...@@ -65,8 +63,6 @@ extern int edac_pci_get_poll_msec(void); ...@@ -65,8 +63,6 @@ extern int edac_pci_get_poll_msec(void);
#define edac_sysfs_pci_teardown() #define edac_sysfs_pci_teardown()
#define edac_pci_get_check_errors() #define edac_pci_get_check_errors()
#define edac_pci_get_poll_msec() #define edac_pci_get_poll_msec()
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
#endif /* __EDAC_MODULE_H__ */
#endif /* __EDAC_MODULE_H__ */
...@@ -46,9 +46,8 @@ static inline void edac_unlock_pci_list(void) ...@@ -46,9 +46,8 @@ static inline void edac_unlock_pci_list(void)
* structure. The chip driver will allocate one of these for each * structure. The chip driver will allocate one of these for each
* edac_pci it is going to control/register with the EDAC CORE. * edac_pci it is going to control/register with the EDAC CORE.
*/ */
struct edac_pci_ctl_info * edac_pci_alloc_ctl_info( struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt,
unsigned int sz_pvt, const char *edac_pci_name)
const char *edac_pci_name)
{ {
struct edac_pci_ctl_info *pci; struct edac_pci_ctl_info *pci;
void *pvt; void *pvt;
...@@ -67,10 +66,11 @@ struct edac_pci_ctl_info * edac_pci_alloc_ctl_info( ...@@ -67,10 +66,11 @@ struct edac_pci_ctl_info * edac_pci_alloc_ctl_info(
pci->op_state = OP_ALLOC; pci->op_state = OP_ALLOC;
snprintf(pci->name, strlen(edac_pci_name)+1, "%s", edac_pci_name); snprintf(pci->name, strlen(edac_pci_name) + 1, "%s", edac_pci_name);
return pci; return pci;
} }
EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info);
/* /*
...@@ -81,13 +81,14 @@ void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci) ...@@ -81,13 +81,14 @@ void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci)
{ {
kfree(pci); kfree(pci);
} }
EXPORT_SYMBOL_GPL(edac_pci_free_ctl_info); EXPORT_SYMBOL_GPL(edac_pci_free_ctl_info);
/* /*
* find_edac_pci_by_dev() * find_edac_pci_by_dev()
* scans the edac_pci list for a specific 'struct device *' * scans the edac_pci list for a specific 'struct device *'
*/ */
static struct edac_pci_ctl_info * find_edac_pci_by_dev(struct device *dev) static struct edac_pci_ctl_info *find_edac_pci_by_dev(struct device *dev)
{ {
struct edac_pci_ctl_info *pci; struct edac_pci_ctl_info *pci;
struct list_head *item; struct list_head *item;
...@@ -139,17 +140,18 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci) ...@@ -139,17 +140,18 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci)
list_add_tail_rcu(&pci->link, insert_before); list_add_tail_rcu(&pci->link, insert_before);
return 0; return 0;
fail0: fail0:
edac_printk(KERN_WARNING, EDAC_PCI, edac_printk(KERN_WARNING, EDAC_PCI,
"%s (%s) %s %s already assigned %d\n", "%s (%s) %s %s already assigned %d\n",
rover->dev->bus_id, dev_name(rover), rover->dev->bus_id, dev_name(rover),
rover->mod_name, rover->ctl_name, rover->pci_idx); rover->mod_name, rover->ctl_name, rover->pci_idx);
return 1; return 1;
fail1: fail1:
edac_printk(KERN_WARNING, EDAC_PCI, edac_printk(KERN_WARNING, EDAC_PCI,
"but in low-level driver: attempt to assign\n" "but in low-level driver: attempt to assign\n"
"\tduplicate pci_idx %d in %s()\n", rover->pci_idx, __func__); "\tduplicate pci_idx %d in %s()\n", rover->pci_idx,
__func__);
return 1; return 1;
} }
...@@ -185,7 +187,7 @@ static void del_edac_pci_from_global_list(struct edac_pci_ctl_info *pci) ...@@ -185,7 +187,7 @@ static void del_edac_pci_from_global_list(struct edac_pci_ctl_info *pci)
* *
* Caller must hold pci_ctls_mutex. * Caller must hold pci_ctls_mutex.
*/ */
struct edac_pci_ctl_info * edac_pci_find(int idx) struct edac_pci_ctl_info *edac_pci_find(int idx)
{ {
struct list_head *item; struct list_head *item;
struct edac_pci_ctl_info *pci; struct edac_pci_ctl_info *pci;
...@@ -198,13 +200,14 @@ struct edac_pci_ctl_info * edac_pci_find(int idx) ...@@ -198,13 +200,14 @@ struct edac_pci_ctl_info * edac_pci_find(int idx)
if (pci->pci_idx == idx) if (pci->pci_idx == idx)
return pci; return pci;
/* not on list, so terminate early */ /* not on list, so terminate early */
break; break;
} }
} }
return NULL; return NULL;
} }
EXPORT_SYMBOL_GPL(edac_pci_find); EXPORT_SYMBOL_GPL(edac_pci_find);
/* /*
...@@ -225,15 +228,14 @@ static void edac_pci_workq_function(void *ptr) ...@@ -225,15 +228,14 @@ static void edac_pci_workq_function(void *ptr)
edac_lock_pci_list(); edac_lock_pci_list();
if ((pci->op_state == OP_RUNNING_POLL) && if ((pci->op_state == OP_RUNNING_POLL) &&
(pci->edac_check != NULL) && (pci->edac_check != NULL) && (edac_pci_get_check_errors()))
(edac_pci_get_check_errors()))
pci->edac_check(pci); pci->edac_check(pci);
edac_unlock_pci_list(); edac_unlock_pci_list();
/* Reschedule */ /* Reschedule */
queue_delayed_work(edac_workqueue, &pci->work, queue_delayed_work(edac_workqueue, &pci->work,
msecs_to_jiffies(edac_pci_get_poll_msec())); msecs_to_jiffies(edac_pci_get_poll_msec()));
} }
/* /*
...@@ -242,7 +244,7 @@ static void edac_pci_workq_function(void *ptr) ...@@ -242,7 +244,7 @@ static void edac_pci_workq_function(void *ptr)
* passing in the new delay period in msec * passing in the new delay period in msec
*/ */
static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci, static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci,
unsigned int msec) unsigned int msec)
{ {
debugf0("%s()\n", __func__); debugf0("%s()\n", __func__);
...@@ -252,7 +254,7 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci, ...@@ -252,7 +254,7 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci,
INIT_WORK(&pci->work, edac_pci_workq_function, pci); INIT_WORK(&pci->work, edac_pci_workq_function, pci);
#endif #endif
queue_delayed_work(edac_workqueue, &pci->work, queue_delayed_work(edac_workqueue, &pci->work,
msecs_to_jiffies(edac_pci_get_poll_msec())); msecs_to_jiffies(edac_pci_get_poll_msec()));
} }
/* /*
...@@ -272,7 +274,7 @@ static void edac_pci_workq_teardown(struct edac_pci_ctl_info *pci) ...@@ -272,7 +274,7 @@ static void edac_pci_workq_teardown(struct edac_pci_ctl_info *pci)
* edac_pci_reset_delay_period * edac_pci_reset_delay_period
*/ */
void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
unsigned long value) unsigned long value)
{ {
edac_lock_pci_list(); edac_lock_pci_list();
...@@ -282,6 +284,7 @@ void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, ...@@ -282,6 +284,7 @@ void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
edac_unlock_pci_list(); edac_unlock_pci_list();
} }
EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period); EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
/* /*
...@@ -324,22 +327,22 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx) ...@@ -324,22 +327,22 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx)
} }
edac_pci_printk(pci, KERN_INFO, edac_pci_printk(pci, KERN_INFO,
"Giving out device to module '%s' controller '%s':" "Giving out device to module '%s' controller '%s':"
" DEV '%s' (%s)\n", " DEV '%s' (%s)\n",
pci->mod_name, pci->mod_name,
pci->ctl_name, pci->ctl_name,
dev_name(pci), dev_name(pci), edac_op_state_toString(pci->op_state));
edac_op_state_toString(pci->op_state));
edac_unlock_pci_list(); edac_unlock_pci_list();
return 0; return 0;
fail1: fail1:
del_edac_pci_from_global_list(pci); del_edac_pci_from_global_list(pci);
fail0: fail0:
edac_unlock_pci_list(); edac_unlock_pci_list();
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(edac_pci_add_device); EXPORT_SYMBOL_GPL(edac_pci_add_device);
/* /*
...@@ -355,7 +358,7 @@ EXPORT_SYMBOL_GPL(edac_pci_add_device); ...@@ -355,7 +358,7 @@ EXPORT_SYMBOL_GPL(edac_pci_add_device);
* Pointer to removed edac_pci structure, * Pointer to removed edac_pci structure,
* or NULL if device not found * or NULL if device not found
*/ */
struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev) struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev)
{ {
struct edac_pci_ctl_info *pci; struct edac_pci_ctl_info *pci;
...@@ -379,14 +382,12 @@ struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev) ...@@ -379,14 +382,12 @@ struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev)
edac_unlock_pci_list(); edac_unlock_pci_list();
edac_printk(KERN_INFO, EDAC_PCI, edac_printk(KERN_INFO, EDAC_PCI,
"Removed device %d for %s %s: DEV %s\n", "Removed device %d for %s %s: DEV %s\n",
pci->pci_idx, pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci));
pci->mod_name,
pci->ctl_name,
dev_name(pci));
return pci; return pci;
} }
EXPORT_SYMBOL_GPL(edac_pci_del_device); EXPORT_SYMBOL_GPL(edac_pci_del_device);
void edac_pci_generic_check(struct edac_pci_ctl_info *pci) void edac_pci_generic_check(struct edac_pci_ctl_info *pci)
...@@ -401,8 +402,8 @@ struct edac_pci_gen_data { ...@@ -401,8 +402,8 @@ struct edac_pci_gen_data {
int edac_idx; int edac_idx;
}; };
struct edac_pci_ctl_info * struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev,
edac_pci_create_generic_ctl(struct device *dev, const char *mod_name) const char *mod_name)
{ {
struct edac_pci_ctl_info *pci; struct edac_pci_ctl_info *pci;
struct edac_pci_gen_data *pdata; struct edac_pci_gen_data *pdata;
...@@ -430,6 +431,7 @@ edac_pci_create_generic_ctl(struct device *dev, const char *mod_name) ...@@ -430,6 +431,7 @@ edac_pci_create_generic_ctl(struct device *dev, const char *mod_name)
return pci; return pci;
} }
EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl); EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl);
void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci) void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci)
...@@ -437,4 +439,5 @@ void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci) ...@@ -437,4 +439,5 @@ void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci)
edac_pci_del_device(pci->dev); edac_pci_del_device(pci->dev);
edac_pci_free_ctl_info(pci); edac_pci_free_ctl_info(pci);
} }
EXPORT_SYMBOL_GPL(edac_pci_release_generic_ctl); EXPORT_SYMBOL_GPL(edac_pci_release_generic_ctl);
This diff is collapsed.
...@@ -30,6 +30,7 @@ inline int edac_handler_set(void) ...@@ -30,6 +30,7 @@ inline int edac_handler_set(void)
return atomic_read(&edac_handlers); return atomic_read(&edac_handlers);
} }
EXPORT_SYMBOL(edac_handler_set); EXPORT_SYMBOL(edac_handler_set);
/* /*
...@@ -39,4 +40,5 @@ inline void edac_atomic_assert_error(void) ...@@ -39,4 +40,5 @@ inline void edac_atomic_assert_error(void)
{ {
edac_err_assert++; edac_err_assert++;
} }
EXPORT_SYMBOL(edac_atomic_assert_error); EXPORT_SYMBOL(edac_atomic_assert_error);
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