drivers/edac: core Lindent cleanup

Run the EDAC CORE files through Lindent for cleanup

Signed-off-by: Douglas Thompson <dougthompson@xmission.com>
Signed-off-by: Dave Jiang <djiang@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Douglas Thompson 2007-07-19 01:49:58 -07:00 committed by Linus Torvalds
parent 4de78c6877
commit 079708b917
11 changed files with 722 additions and 821 deletions

View file

@ -462,7 +462,6 @@ struct edac_attrib_spec {
#define EDAC_ATTR_CHAR 0x02
};
/* Attribute control structure
* In this structure is a pointer to the driver's edac_attrib_spec
* The life of this pointer is inclusive in the life of the driver's
@ -509,7 +508,6 @@ struct edac_device_instance {
struct completion kobj_complete;
};
/*
* Abstract edac_device control info structure
*
@ -594,8 +592,7 @@ struct edac_device_ctl_info {
container_of(w,struct edac_device_ctl_info,work)
/* Function to calc the number of delay jiffies from poll_msec */
static inline void edac_device_calc_delay(
struct edac_device_ctl_info *edac_dev)
static inline void edac_device_calc_delay(struct edac_device_ctl_info *edac_dev)
{
/* convert from msec to jiffies */
edac_dev->delay = edac_dev->poll_msec * HZ / 1000;
@ -616,8 +613,7 @@ extern struct edac_device_ctl_info *edac_device_alloc_ctl_info(
unsigned nr_blocks,
unsigned offset_value,
struct edac_attrib_spec *attrib_spec,
unsigned nr_attribs
);
unsigned nr_attribs);
/* The offset value can be:
* -1 indicating no offset value
@ -769,25 +765,23 @@ extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
* statement clutter and extra function arguments.
*/
extern void edac_mc_handle_ce(struct mem_ctl_info *mci,
unsigned long page_frame_number, unsigned long offset_in_page,
unsigned long page_frame_number,
unsigned long offset_in_page,
unsigned long syndrome, int row, int channel,
const char *msg);
extern void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci,
const char *msg);
extern void edac_mc_handle_ue(struct mem_ctl_info *mci,
unsigned long page_frame_number, unsigned long offset_in_page,
int row, const char *msg);
unsigned long page_frame_number,
unsigned long offset_in_page, int row,
const char *msg);
extern void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci,
const char *msg);
extern void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
unsigned int csrow,
unsigned int channel0,
unsigned int channel1,
char *msg);
extern void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
unsigned int csrow,
unsigned int channel,
extern void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci, unsigned int csrow,
unsigned int channel0, unsigned int channel1,
char *msg);
extern void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci, unsigned int csrow,
unsigned int channel, char *msg);
/*
* edac_device APIs
@ -795,7 +789,8 @@ extern void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
extern struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
unsigned nr_chans);
extern void edac_mc_free(struct mem_ctl_info *mci);
extern int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx);
extern int edac_device_add_device(struct edac_device_ctl_info *edac_dev,
int edac_idx);
extern struct edac_device_ctl_info *edac_device_del_device(struct device *dev);
extern void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
int inst_nr, int block_nr, const char *msg);
@ -805,8 +800,8 @@ extern void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
/*
* edac_pci APIs
*/
extern struct edac_pci_ctl_info *
edac_pci_alloc_ctl_info(unsigned int sz_pvt, const char *edac_pci_name);
extern struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, const char
*edac_pci_name);
extern void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci);
@ -816,8 +811,8 @@ edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, unsigned long value);
extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx);
extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev);
extern struct edac_pci_ctl_info *
edac_pci_create_generic_ctl(struct device *dev, const char *mod_name);
extern struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev, const char
*mod_name);
extern void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci);
extern int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci);

View file

@ -35,7 +35,6 @@
static DECLARE_MUTEX(device_ctls_mutex);
static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list);
static inline void lock_device_list(void)
{
down(&device_ctls_mutex);
@ -46,7 +45,6 @@ static inline void unlock_device_list(void)
up(&device_ctls_mutex);
}
#ifdef CONFIG_EDAC_DEBUG
static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
{
@ -71,7 +69,8 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
char *edac_block_name,
unsigned nr_blocks,
unsigned offset_value,
struct edac_attrib_spec *attrib_spec,
struct edac_attrib_spec
*attrib_spec,
unsigned nr_attribs)
{
struct edac_device_ctl_info *dev_ctl;
@ -127,8 +126,7 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
(((char *)dev_ctl) + ((unsigned long)dev_blk));
dev_attrib = (struct edac_attrib *)
(((char *)dev_ctl) + ((unsigned long)dev_attrib));
pvt = sz_private ?
(((char *) dev_ctl) + ((unsigned long) pvt)) : NULL;
pvt = sz_private ? (((char *)dev_ctl) + ((unsigned long)pvt)) : NULL;
memset(dev_ctl, 0, total_size); /* clear all fields */
dev_ctl->nr_instances = nr_instances;
@ -153,9 +151,7 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
inst->name[sizeof(inst->name) - 1] = '\0';
/* Initialize every block in each instance */
for ( block = 0;
block < nr_blocks;
block++) {
for (block = 0; block < nr_blocks; block++) {
blk = &blk_p[block];
blk->instance = inst;
blk->nr_attribs = nr_attribs;
@ -190,6 +186,7 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
return dev_ctl;
}
EXPORT_SYMBOL_GPL(edac_device_alloc_ctl_info);
/*
@ -197,19 +194,18 @@ EXPORT_SYMBOL_GPL(edac_device_alloc_ctl_info);
* frees the memory allocated by the edac_device_alloc_ctl_info()
* function
*/
void edac_device_free_ctl_info( struct edac_device_ctl_info *ctl_info) {
void edac_device_free_ctl_info(struct edac_device_ctl_info *ctl_info)
{
kfree(ctl_info);
}
EXPORT_SYMBOL_GPL(edac_device_free_ctl_info);
/*
* find_edac_device_by_dev
* scans the edac_device list for a specific 'struct device *'
*/
static struct edac_device_ctl_info *
find_edac_device_by_dev(struct device *dev)
static struct edac_device_ctl_info *find_edac_device_by_dev(struct device *dev)
{
struct edac_device_ctl_info *edac_dev;
struct list_head *item;
@ -271,7 +267,8 @@ static int add_edac_dev_to_global_list (struct edac_device_ctl_info *edac_dev)
fail1:
edac_printk(KERN_WARNING, EDAC_MC,
"bug in low-level driver: attempt to assign\n"
" duplicate dev_idx %d in %s()\n", rover->dev_idx, __func__);
" duplicate dev_idx %d in %s()\n", rover->dev_idx,
__func__);
return 1;
}
@ -290,8 +287,8 @@ static void complete_edac_device_list_del(struct rcu_head *head)
/*
* del_edac_device_from_global_list
*/
static void del_edac_device_from_global_list(
struct edac_device_ctl_info *edac_device)
static void del_edac_device_from_global_list(struct edac_device_ctl_info
*edac_device)
{
list_del_rcu(&edac_device->link);
init_completion(&edac_device->complete);
@ -328,8 +325,8 @@ struct edac_device_ctl_info * edac_device_find(int idx)
return NULL;
}
EXPORT_SYMBOL(edac_device_find);
EXPORT_SYMBOL(edac_device_find);
/*
* edac_device_workq_function
@ -339,8 +336,7 @@ EXPORT_SYMBOL(edac_device_find);
static void edac_device_workq_function(struct work_struct *work_req)
{
struct delayed_work *d_work = (struct delayed_work *)work_req;
struct edac_device_ctl_info *edac_dev =
to_edac_device_ctl_work(d_work);
struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work);
#else
static void edac_device_workq_function(void *ptr)
{
@ -403,8 +399,7 @@ void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
* edac_device_reset_delay_period
*/
void edac_device_reset_delay_period(
struct edac_device_ctl_info *edac_dev,
void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
unsigned long value)
{
lock_device_list();
@ -468,7 +463,6 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx)
edac_dev->op_state = OP_RUNNING_INTERRUPT;
}
/* Report action taken */
edac_device_printk(edac_dev, KERN_INFO,
"Giving out device to module '%s' controller '%s': DEV '%s' (%s)\n",
@ -489,6 +483,7 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx)
unlock_device_list();
return 1;
}
EXPORT_SYMBOL_GPL(edac_device_add_device);
/**
@ -534,14 +529,12 @@ struct edac_device_ctl_info * edac_device_del_device(struct device *dev)
edac_printk(KERN_INFO, EDAC_MC,
"Removed device %d for %s %s: DEV %s\n",
edac_dev->dev_idx,
edac_dev->mod_name,
edac_dev->ctl_name,
dev_name(edac_dev));
edac_dev->mod_name, edac_dev->ctl_name, dev_name(edac_dev));
return edac_dev;
}
EXPORT_SYMBOL_GPL(edac_device_del_device);
EXPORT_SYMBOL_GPL(edac_device_del_device);
static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev)
{
@ -553,8 +546,8 @@ static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
return edac_dev->log_ue;
}
static inline int edac_device_get_panic_on_ue(
struct edac_device_ctl_info *edac_dev)
static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info
*edac_dev)
{
return edac_dev->panic_on_ue;
}
@ -572,7 +565,8 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
edac_device_printk(edac_dev, KERN_ERR,
"INTERNAL ERROR: 'instance' out of range "
"(%d >= %d)\n", inst_nr, edac_dev->nr_instances);
"(%d >= %d)\n", inst_nr,
edac_dev->nr_instances);
return;
}
@ -581,7 +575,8 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
edac_device_printk(edac_dev, KERN_ERR,
"INTERNAL ERROR: instance %d 'block' out of range "
"(%d >= %d)\n", inst_nr, block_nr, instance->nr_blocks);
"(%d >= %d)\n", inst_nr, block_nr,
instance->nr_blocks);
return;
}
@ -600,6 +595,7 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
edac_dev->ctl_name, instance->name,
block ? block->name : "N/A", msg);
}
EXPORT_SYMBOL_GPL(edac_device_handle_ce);
/*
@ -615,7 +611,8 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
edac_device_printk(edac_dev, KERN_ERR,
"INTERNAL ERROR: 'instance' out of range "
"(%d >= %d)\n", inst_nr, edac_dev->nr_instances);
"(%d >= %d)\n", inst_nr,
edac_dev->nr_instances);
return;
}
@ -624,7 +621,8 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
edac_device_printk(edac_dev, KERN_ERR,
"INTERNAL ERROR: instance %d 'block' out of range "
"(%d >= %d)\n", inst_nr, block_nr, instance->nr_blocks);
"(%d >= %d)\n", inst_nr, block_nr,
instance->nr_blocks);
return;
}
@ -648,5 +646,5 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
edac_dev->ctl_name, instance->name,
block ? block->name : "N/A", msg);
}
EXPORT_SYMBOL_GPL(edac_device_handle_ue);
EXPORT_SYMBOL_GPL(edac_device_handle_ue);

View file

@ -16,7 +16,6 @@
#include "edac_core.h"
#include "edac_module.h"
#define EDAC_DEVICE_SYMLINK "device"
#define to_edacdev(k) container_of(k, struct edac_device_ctl_info, kobj)
@ -48,14 +47,12 @@ static ssize_t edac_dev_ctl_name_show(struct edac_device_ctl_info *edac_dev,
return sprintf(data, "%s\n", edac_dev->ctl_name);
}
struct edacdev_attribute {
struct attribute attr;
ssize_t(*show) (struct edac_device_ctl_info *, char *);
ssize_t(*store) (struct edac_device_ctl_info *, const char *, size_t);
};
/* EDAC DEVICE show/store functions for top most object */
static ssize_t edacdev_show(struct kobject *kobj, struct attribute *attr,
char *buffer)
@ -102,7 +99,6 @@ EDACDEV_ATTR(seconds_since_reset,S_IRUGO,edac_dev_seconds_show,NULL);
EDACDEV_ATTR(ue_count, S_IRUGO, edac_dev_ue_count_show, NULL);
EDACDEV_ATTR(ce_count, S_IRUGO, edac_dev_ce_count_show, NULL);
static struct edacdev_attribute *edacdev_attr[] = {
&edacdev_attr_reset_counters,
&edacdev_attr_mc_name,
@ -139,15 +135,15 @@ static struct kobj_type ktype_device = {
*/
/* 'log_ue' */
static ssize_t edac_device_ctl_log_ue_show(
struct edac_device_ctl_info *ctl_info, char *data)
static ssize_t edac_device_ctl_log_ue_show(struct edac_device_ctl_info
*ctl_info, char *data)
{
return sprintf(data, "%u\n", ctl_info->log_ue);
}
static ssize_t edac_device_ctl_log_ue_store(
struct edac_device_ctl_info *ctl_info,
const char *data,size_t count)
static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info
*ctl_info, const char *data,
size_t count)
{
/* if parameter is zero, turn off flag, if non-zero turn on flag */
ctl_info->log_ue = (simple_strtoul(data, NULL, 0) != 0);
@ -156,15 +152,15 @@ static ssize_t edac_device_ctl_log_ue_store(
}
/* 'log_ce' */
static ssize_t edac_device_ctl_log_ce_show(
struct edac_device_ctl_info *ctl_info,char *data)
static ssize_t edac_device_ctl_log_ce_show(struct edac_device_ctl_info
*ctl_info, char *data)
{
return sprintf(data, "%u\n", ctl_info->log_ce);
}
static ssize_t edac_device_ctl_log_ce_store(
struct edac_device_ctl_info *ctl_info,
const char *data,size_t count)
static ssize_t edac_device_ctl_log_ce_store(struct edac_device_ctl_info
*ctl_info, const char *data,
size_t count)
{
/* if parameter is zero, turn off flag, if non-zero turn on flag */
ctl_info->log_ce = (simple_strtoul(data, NULL, 0) != 0);
@ -172,17 +168,16 @@ static ssize_t edac_device_ctl_log_ce_store(
return count;
}
/* 'panic_on_ue' */
static ssize_t edac_device_ctl_panic_on_ue_show(
struct edac_device_ctl_info *ctl_info, char *data)
static ssize_t edac_device_ctl_panic_on_ue_show(struct edac_device_ctl_info
*ctl_info, char *data)
{
return sprintf(data, "%u\n", ctl_info->panic_on_ue);
}
static ssize_t edac_device_ctl_panic_on_ue_store(
struct edac_device_ctl_info *ctl_info,
const char *data,size_t count)
static ssize_t edac_device_ctl_panic_on_ue_store(struct edac_device_ctl_info
*ctl_info, const char *data,
size_t count)
{
/* if parameter is zero, turn off flag, if non-zero turn on flag */
ctl_info->panic_on_ue = (simple_strtoul(data, NULL, 0) != 0);
@ -191,15 +186,15 @@ static ssize_t edac_device_ctl_panic_on_ue_store(
}
/* 'poll_msec' show and store functions*/
static ssize_t edac_device_ctl_poll_msec_show(
struct edac_device_ctl_info *ctl_info, char *data)
static ssize_t edac_device_ctl_poll_msec_show(struct edac_device_ctl_info
*ctl_info, char *data)
{
return sprintf(data, "%u\n", ctl_info->poll_msec);
}
static ssize_t edac_device_ctl_poll_msec_store(
struct edac_device_ctl_info *ctl_info,
const char *data,size_t count)
static ssize_t edac_device_ctl_poll_msec_store(struct edac_device_ctl_info
*ctl_info, const char *data,
size_t count)
{
unsigned long value;
@ -214,7 +209,6 @@ static ssize_t edac_device_ctl_poll_msec_store(
return count;
}
/* edac_device_ctl_info specific attribute structure */
struct ctl_info_attribute {
struct attribute attr;
@ -227,8 +221,7 @@ struct ctl_info_attribute {
/* Function to 'show' fields from the edac_dev 'ctl_info' structure */
static ssize_t edac_dev_ctl_info_show(struct kobject *kobj,
struct attribute *attr,
char *buffer)
struct attribute *attr, char *buffer)
{
struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj);
struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr);
@ -264,21 +257,16 @@ static struct ctl_info_attribute attr_ctl_info_##_name = { \
.store = _store, \
};
/* Declare the various ctl_info attributes here and their respective ops */
CTL_INFO_ATTR(log_ue, S_IRUGO | S_IWUSR,
edac_device_ctl_log_ue_show,
edac_device_ctl_log_ue_store);
edac_device_ctl_log_ue_show, edac_device_ctl_log_ue_store);
CTL_INFO_ATTR(log_ce, S_IRUGO | S_IWUSR,
edac_device_ctl_log_ce_show,
edac_device_ctl_log_ce_store);
edac_device_ctl_log_ce_show, edac_device_ctl_log_ce_store);
CTL_INFO_ATTR(panic_on_ue, S_IRUGO | S_IWUSR,
edac_device_ctl_panic_on_ue_show,
edac_device_ctl_panic_on_ue_store);
CTL_INFO_ATTR(poll_msec, S_IRUGO | S_IWUSR,
edac_device_ctl_poll_msec_show,
edac_device_ctl_poll_msec_store);
edac_device_ctl_poll_msec_show, edac_device_ctl_poll_msec_store);
/* Base Attributes of the EDAC_DEVICE ECC object */
static struct ctl_info_attribute *device_ctrl_attr[] = {
@ -306,7 +294,6 @@ static struct kobj_type ktype_device_ctrl = {
.default_attrs = (struct attribute **)device_ctrl_attr,
};
/**************** edac_device main kobj ctor/dtor code *********************/
/*
@ -317,8 +304,7 @@ static struct kobj_type ktype_device_ctrl = {
* Return: 0 SUCCESS
* !0 FAILURE
*/
static int edac_device_register_main_kobj(
struct edac_device_ctl_info *edac_dev)
static int edac_device_register_main_kobj(struct edac_device_ctl_info *edac_dev)
{
int err = 0;
struct sysdev_class *edac_class;
@ -343,8 +329,7 @@ static int edac_device_register_main_kobj(
edac_dev->kobj.parent = &edac_class->kset.kobj;
/* generate sysfs "..../edac/<name>" */
debugf1("%s() set name of kobject to: %s\n",
__func__, edac_dev->name);
debugf1("%s() set name of kobject to: %s\n", __func__, edac_dev->name);
err = kobject_set_name(&edac_dev->kobj, "%s", edac_dev->name);
if (err)
return err;
@ -365,8 +350,8 @@ static int edac_device_register_main_kobj(
* edac_device_unregister_main_kobj:
* the '..../edac/<name>' kobject
*/
static void edac_device_unregister_main_kobj(
struct edac_device_ctl_info *edac_dev)
static void edac_device_unregister_main_kobj(struct edac_device_ctl_info
*edac_dev)
{
debugf0("%s()\n", __func__);
debugf1("%s() name of kobject is: %s\n",
@ -382,26 +367,23 @@ static void edac_device_unregister_main_kobj(
wait_for_completion(&edac_dev->kobj_complete);
}
/*************** edac_dev -> instance information ***********/
/*
* Set of low-level instance attribute show functions
*/
static ssize_t instance_ue_count_show(
struct edac_device_instance *instance, char *data)
static ssize_t instance_ue_count_show(struct edac_device_instance *instance,
char *data)
{
return sprintf(data, "%u\n", instance->counters.ue_count);
}
static ssize_t instance_ce_count_show(
struct edac_device_instance *instance, char *data)
static ssize_t instance_ce_count_show(struct edac_device_instance *instance,
char *data)
{
return sprintf(data, "%u\n", instance->counters.ce_count);
}
#define to_instance(k) container_of(k, struct edac_device_instance, kobj)
#define to_instance_attr(a) container_of(a,struct instance_attribute,attr)
@ -416,7 +398,6 @@ static void edac_device_ctrl_instance_release(struct kobject *kobj)
complete(&instance->kobj_complete);
}
/* instance specific attribute structure */
struct instance_attribute {
struct attribute attr;
@ -424,11 +405,9 @@ struct instance_attribute {
ssize_t(*store) (struct edac_device_instance *, const char *, size_t);
};
/* Function to 'show' fields from the edac_dev 'instance' structure */
static ssize_t edac_dev_instance_show(struct kobject *kobj,
struct attribute *attr,
char *buffer)
struct attribute *attr, char *buffer)
{
struct edac_device_instance *instance = to_instance(kobj);
struct instance_attribute *instance_attr = to_instance_attr(attr);
@ -438,7 +417,6 @@ static ssize_t edac_dev_instance_show(struct kobject *kobj,
return -EIO;
}
/* Function to 'store' fields into the edac_dev 'instance' structure */
static ssize_t edac_dev_instance_store(struct kobject *kobj,
struct attribute *attr,
@ -452,8 +430,6 @@ static ssize_t edac_dev_instance_store(struct kobject *kobj,
return -EIO;
}
/* edac_dev file operations for an 'instance' */
static struct sysfs_ops device_instance_ops = {
.show = edac_dev_instance_show,
@ -489,26 +465,21 @@ static struct kobj_type ktype_instance_ctrl = {
.default_attrs = (struct attribute **)device_instance_attr,
};
/*************** edac_dev -> instance -> block information *********/
/*
* Set of low-level block attribute show functions
*/
static ssize_t block_ue_count_show(
struct edac_device_block *block, char *data)
static ssize_t block_ue_count_show(struct edac_device_block *block, char *data)
{
return sprintf(data, "%u\n", block->counters.ue_count);
}
static ssize_t block_ce_count_show(
struct edac_device_block *block, char *data)
static ssize_t block_ce_count_show(struct edac_device_block *block, char *data)
{
return sprintf(data, "%u\n", block->counters.ce_count);
}
#define to_block(k) container_of(k, struct edac_device_block, kobj)
#define to_block_attr(a) container_of(a,struct block_attribute,attr)
@ -532,8 +503,7 @@ struct block_attribute {
/* Function to 'show' fields from the edac_dev 'block' structure */
static ssize_t edac_dev_block_show(struct kobject *kobj,
struct attribute *attr,
char *buffer)
struct attribute *attr, char *buffer)
{
struct edac_device_block *block = to_block(kobj);
struct block_attribute *block_attr = to_block_attr(attr);
@ -543,7 +513,6 @@ static ssize_t edac_dev_block_show(struct kobject *kobj,
return -EIO;
}
/* Function to 'store' fields into the edac_dev 'block' structure */
static ssize_t edac_dev_block_store(struct kobject *kobj,
struct attribute *attr,
@ -557,14 +526,12 @@ static ssize_t edac_dev_block_store(struct kobject *kobj,
return -EIO;
}
/* edac_dev file operations for a 'block' */
static struct sysfs_ops device_block_ops = {
.show = edac_dev_block_show,
.store = edac_dev_block_store
};
#define BLOCK_ATTR(_name,_mode,_show,_store) \
static struct block_attribute attr_block_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode }, \
@ -575,7 +542,6 @@ static struct block_attribute attr_block_##_name = { \
BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show, NULL);
/* list of edac_dev 'block' attributes */
static struct block_attribute *device_block_attr[] = {
&attr_block_ce_count,
@ -590,14 +556,12 @@ static struct kobj_type ktype_block_ctrl = {
.default_attrs = (struct attribute **)device_block_attr,
};
/************** block ctor/dtor code ************/
/*
* edac_device_create_block
*/
static int edac_device_create_block(
struct edac_device_ctl_info *edac_dev,
static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
struct edac_device_instance *instance,
int idx)
{
@ -631,8 +595,7 @@ static int edac_device_create_block(
/*
* edac_device_delete_block(edac_dev,j);
*/
static void edac_device_delete_block(
struct edac_device_ctl_info *edac_dev,
static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
struct edac_device_instance *instance,
int idx)
{
@ -652,8 +615,8 @@ static void edac_device_delete_block(
* edac_device_create_instance
* create just one instance of an edac_device 'instance'
*/
static int edac_device_create_instance(
struct edac_device_ctl_info *edac_dev, int idx)
static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
int idx)
{
int i, j;
int err;
@ -703,8 +666,8 @@ static int edac_device_create_instance(
* edac_device_remove_instance
* remove an edac_device instance
*/
static void edac_device_delete_instance(
struct edac_device_ctl_info *edac_dev, int idx)
static void edac_device_delete_instance(struct edac_device_ctl_info *edac_dev,
int idx)
{
int i;
struct edac_device_instance *instance;
@ -790,8 +753,7 @@ int edac_device_create_sysfs(struct edac_device_ctl_info *edac_dev)
* to the platform 'device' being used for this
*/
err = sysfs_create_link(edac_kobj,
&edac_dev->dev->kobj,
EDAC_DEVICE_SYMLINK);
&edac_dev->dev->kobj, EDAC_DEVICE_SYMLINK);
if (err) {
debugf0("%s() sysfs_create_link() returned err= %d\n",
__func__, err);
@ -834,4 +796,3 @@ void edac_device_remove_sysfs(struct edac_device_ctl_info *edac_dev)
/* unregister the instance's main kobj */
edac_device_unregister_main_kobj(edac_dev);
}

View file

@ -34,7 +34,6 @@
#include "edac_core.h"
#include "edac_module.h"
/* lock to memory controller's control array */
static DEFINE_MUTEX(mem_ctls_mutex);
static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices);
@ -54,13 +53,11 @@ static void edac_mc_dump_csrow(struct csrow_info *csrow)
{
debugf4("\tcsrow = %p\n", csrow);
debugf4("\tcsrow->csrow_idx = %d\n", csrow->csrow_idx);
debugf4("\tcsrow->first_page = 0x%lx\n",
csrow->first_page);
debugf4("\tcsrow->first_page = 0x%lx\n", csrow->first_page);
debugf4("\tcsrow->last_page = 0x%lx\n", csrow->last_page);
debugf4("\tcsrow->page_mask = 0x%lx\n", csrow->page_mask);
debugf4("\tcsrow->nr_pages = 0x%x\n", csrow->nr_pages);
debugf4("\tcsrow->nr_channels = %d\n",
csrow->nr_channels);
debugf4("\tcsrow->nr_channels = %d\n", csrow->nr_channels);
debugf4("\tcsrow->channels = %p\n", csrow->channels);
debugf4("\tcsrow->mci = %p\n\n", csrow->mci);
}
@ -75,8 +72,7 @@ static void edac_mc_dump_mci(struct mem_ctl_info *mci)
debugf3("\tmci->nr_csrows = %d, csrows = %p\n",
mci->nr_csrows, mci->csrows);
debugf3("\tdev = %p\n", mci->dev);
debugf3("\tmod_name:ctl_name = %s:%s\n",
mci->mod_name, mci->ctl_name);
debugf3("\tmod_name:ctl_name = %s:%s\n", mci->mod_name, mci->ctl_name);
debugf3("\tpvt_info = %p\n\n", mci->pvt_info);
}
@ -188,6 +184,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
return mci;
}
EXPORT_SYMBOL_GPL(edac_mc_alloc);
/**
@ -198,6 +195,7 @@ void edac_mc_free(struct mem_ctl_info *mci)
{
kfree(mci);
}
EXPORT_SYMBOL_GPL(edac_mc_free);
static struct mem_ctl_info *find_mci_by_dev(struct device *dev)
@ -403,6 +401,7 @@ struct mem_ctl_info * edac_mc_find(int idx)
return NULL;
}
EXPORT_SYMBOL(edac_mc_find);
/**
@ -433,8 +432,8 @@ int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx)
edac_mc_dump_csrow(&mci->csrows[i]);
for (j = 0; j < mci->csrows[i].nr_channels; j++)
edac_mc_dump_channel(
&mci->csrows[i].channels[j]);
edac_mc_dump_channel(&mci->csrows[i].
channels[j]);
}
}
#endif
@ -476,6 +475,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx)
mutex_unlock(&mem_ctls_mutex);
return 1;
}
EXPORT_SYMBOL_GPL(edac_mc_add_mc);
/**
@ -511,6 +511,7 @@ struct mem_ctl_info * edac_mc_del_mc(struct device *dev)
mci->mod_name, mci->ctl_name, dev_name(mci));
return mci;
}
EXPORT_SYMBOL_GPL(edac_mc_del_mc);
static void edac_mc_scrub_block(unsigned long page, unsigned long offset,
@ -580,13 +581,15 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page)
return row;
}
EXPORT_SYMBOL_GPL(edac_mc_find_csrow_by_page);
/* FIXME - setable log (warning/emerg) levels */
/* FIXME - integrate with evlog: http://evlog.sourceforge.net/ */
void edac_mc_handle_ce(struct mem_ctl_info *mci,
unsigned long page_frame_number, unsigned long offset_in_page,
unsigned long syndrome, int row, int channel, const char *msg)
unsigned long page_frame_number,
unsigned long offset_in_page, unsigned long syndrome,
int row, int channel, const char *msg)
{
unsigned long remapped_page;
@ -643,6 +646,7 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
mci->csrows[row].grain);
}
}
EXPORT_SYMBOL_GPL(edac_mc_handle_ce);
void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
@ -654,11 +658,12 @@ void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
mci->ce_noinfo_count++;
mci->ce_count++;
}
EXPORT_SYMBOL_GPL(edac_mc_handle_ce_no_info);
void edac_mc_handle_ue(struct mem_ctl_info *mci,
unsigned long page_frame_number, unsigned long offset_in_page,
int row, const char *msg)
unsigned long page_frame_number,
unsigned long offset_in_page, int row, const char *msg)
{
int len = EDAC_MC_LABEL_LEN * 4;
char labels[len + 1];
@ -695,8 +700,8 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
edac_mc_printk(mci, KERN_EMERG,
"UE page 0x%lx, offset 0x%lx, grain %d, row %d, "
"labels \"%s\": %s\n", page_frame_number,
offset_in_page, mci->csrows[row].grain, row, labels,
msg);
offset_in_page, mci->csrows[row].grain, row,
labels, msg);
if (edac_mc_get_panic_on_ue())
panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, "
@ -707,6 +712,7 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
mci->ue_count++;
mci->csrows[row].ue_count++;
}
EXPORT_SYMBOL_GPL(edac_mc_handle_ue);
void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
@ -720,8 +726,8 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
mci->ue_noinfo_count++;
mci->ue_count++;
}
EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info);
EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info);
/*************************************************************
* On Fully Buffered DIMM modules, this help function is
@ -730,8 +736,7 @@ EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info);
void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
unsigned int csrow,
unsigned int channela,
unsigned int channelb,
char *msg)
unsigned int channelb, char *msg)
{
int len = EDAC_MC_LABEL_LEN * 4;
char labels[len + 1];
@ -773,7 +778,8 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
/* Generate the DIMM labels from the specified channels */
chars = snprintf(pos, len + 1, "%s",
mci->csrows[csrow].channels[channela].label);
len -= chars; pos += chars;
len -= chars;
pos += chars;
chars = snprintf(pos, len + 1, "-%s",
mci->csrows[csrow].channels[channelb].label);
@ -788,6 +794,7 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
"labels \"%s\": %s\n", csrow, channela,
channelb, labels, msg);
}
EXPORT_SYMBOL(edac_mc_handle_fbd_ue);
/*************************************************************
@ -795,9 +802,7 @@ EXPORT_SYMBOL(edac_mc_handle_fbd_ue);
* called to process CE events
*/
void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
unsigned int csrow,
unsigned int channel,
char *msg)
unsigned int csrow, unsigned int channel, char *msg)
{
/* Ensure boundary values */
@ -823,15 +828,14 @@ void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
edac_mc_printk(mci, KERN_WARNING,
"CE row %d, channel %d, label \"%s\": %s\n",
csrow, channel,
mci->csrows[csrow].channels[channel].label,
msg);
mci->csrows[csrow].channels[channel].label, msg);
mci->ce_count++;
mci->csrows[csrow].ce_count++;
mci->csrows[csrow].channels[channel].ce_count++;
}
EXPORT_SYMBOL(edac_mc_handle_fbd_ce);
EXPORT_SYMBOL(edac_mc_handle_fbd_ce);
/*
* Iterate over all MC instances and check for ECC, et al, errors

View file

@ -1,9 +1,7 @@
/*
* Older .h file for edac, until all drivers are modified
*
*/
#include "edac_core.h"

View file

@ -55,7 +55,6 @@ MODULE_PARM_DESC(edac_mc_log_ce,
module_param(edac_mc_poll_msec, int, 0644);
MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds");
/*
* various constants for Memory Controllers
*/
@ -185,24 +184,16 @@ static struct memctrl_dev_attribute attr_##_name = { \
/* csrow<id> control files */
MEMCTRL_ATTR(edac_mc_panic_on_ue,
S_IRUGO | S_IWUSR,
memctrl_int_show,
memctrl_int_store);
S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
MEMCTRL_ATTR(edac_mc_log_ue,
S_IRUGO|S_IWUSR,
memctrl_int_show,
memctrl_int_store);
S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
MEMCTRL_ATTR(edac_mc_log_ce,
S_IRUGO|S_IWUSR,
memctrl_int_show,
memctrl_int_store);
S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
MEMCTRL_ATTR(edac_mc_poll_msec,
S_IRUGO|S_IWUSR,
memctrl_int_show,
memctrl_int_store);
S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
/* Base Attributes of the memory ECC object */
static struct memctrl_dev_attribute *memctrl_attr[] = {
@ -286,7 +277,6 @@ void edac_sysfs_memctrl_teardown(void)
wait_for_completion(&edac_memctrl_kobj_complete);
}
/* EDAC sysfs CSROW data structures and methods
*/
@ -337,8 +327,7 @@ static ssize_t channel_dimm_label_show(struct csrow_info *csrow,
static ssize_t channel_dimm_label_store(struct csrow_info *csrow,
const char *data,
size_t count,
int channel)
size_t count, int channel)
{
ssize_t max_size = 0;
@ -351,8 +340,7 @@ static ssize_t channel_dimm_label_store(struct csrow_info *csrow,
/* show function for dynamic chX_ce_count attribute */
static ssize_t channel_ce_count_show(struct csrow_info *csrow,
char *data,
int channel)
char *data, int channel)
{
return sprintf(data, "%u\n", csrow->channels[channel].ce_count);
}
@ -370,16 +358,14 @@ struct csrowdev_attribute {
/* Set of show/store higher level functions for default csrow attributes */
static ssize_t csrowdev_show(struct kobject *kobj,
struct attribute *attr,
char *buffer)
struct attribute *attr, char *buffer)
{
struct csrow_info *csrow = to_csrow(kobj);
struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr);
if (csrowdev_attr->show)
return csrowdev_attr->show(csrow,
buffer,
csrowdev_attr->private);
buffer, csrowdev_attr->private);
return -EIO;
}
@ -392,8 +378,7 @@ static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr,
if (csrowdev_attr->store)
return csrowdev_attr->store(csrow,
buffer,
count,
csrowdev_attr->private);
count, csrowdev_attr->private);
return -EIO;
}
@ -429,32 +414,19 @@ static struct csrowdev_attribute *default_csrow_attr[] = {
NULL,
};
/* possible dynamic channel DIMM Label attribute files */
CSROWDEV_ATTR(ch0_dimm_label, S_IRUGO | S_IWUSR,
channel_dimm_label_show,
channel_dimm_label_store,
0 );
channel_dimm_label_show, channel_dimm_label_store, 0);
CSROWDEV_ATTR(ch1_dimm_label, S_IRUGO | S_IWUSR,
channel_dimm_label_show,
channel_dimm_label_store,
1 );
channel_dimm_label_show, channel_dimm_label_store, 1);
CSROWDEV_ATTR(ch2_dimm_label, S_IRUGO | S_IWUSR,
channel_dimm_label_show,
channel_dimm_label_store,
2 );
channel_dimm_label_show, channel_dimm_label_store, 2);
CSROWDEV_ATTR(ch3_dimm_label, S_IRUGO | S_IWUSR,
channel_dimm_label_show,
channel_dimm_label_store,
3 );
channel_dimm_label_show, channel_dimm_label_store, 3);
CSROWDEV_ATTR(ch4_dimm_label, S_IRUGO | S_IWUSR,
channel_dimm_label_show,
channel_dimm_label_store,
4 );
channel_dimm_label_show, channel_dimm_label_store, 4);
CSROWDEV_ATTR(ch5_dimm_label, S_IRUGO | S_IWUSR,
channel_dimm_label_show,
channel_dimm_label_store,
5 );
channel_dimm_label_show, channel_dimm_label_store, 5);
/* Total possible dynamic DIMM Label attribute file table */
static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = {
@ -467,30 +439,12 @@ static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = {
};
/* possible dynamic channel ce_count attribute files */
CSROWDEV_ATTR(ch0_ce_count,S_IRUGO|S_IWUSR,
channel_ce_count_show,
NULL,
0 );
CSROWDEV_ATTR(ch1_ce_count,S_IRUGO|S_IWUSR,
channel_ce_count_show,
NULL,
1 );
CSROWDEV_ATTR(ch2_ce_count,S_IRUGO|S_IWUSR,
channel_ce_count_show,
NULL,
2 );
CSROWDEV_ATTR(ch3_ce_count,S_IRUGO|S_IWUSR,
channel_ce_count_show,
NULL,
3 );
CSROWDEV_ATTR(ch4_ce_count,S_IRUGO|S_IWUSR,
channel_ce_count_show,
NULL,
4 );
CSROWDEV_ATTR(ch5_ce_count,S_IRUGO|S_IWUSR,
channel_ce_count_show,
NULL,
5 );
CSROWDEV_ATTR(ch0_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 0);
CSROWDEV_ATTR(ch1_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 1);
CSROWDEV_ATTR(ch2_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 2);
CSROWDEV_ATTR(ch3_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 3);
CSROWDEV_ATTR(ch4_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 4);
CSROWDEV_ATTR(ch5_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 5);
/* Total possible dynamic ce_count attribute file table */
static struct csrowdev_attribute *dynamic_csrow_ce_count_attr[] = {
@ -502,7 +456,6 @@ static struct csrowdev_attribute *dynamic_csrow_ce_count_attr[] = {
&attr_ch5_ce_count
};
#define EDAC_NR_CHANNELS 6
/* Create dynamic CHANNEL files, indexed by 'chan', under specifed CSROW */
@ -515,12 +468,14 @@ static int edac_create_channel_files(struct kobject *kobj, int chan)
/* create the DIMM label attribute file */
err = sysfs_create_file(kobj,
(struct attribute *) dynamic_csrow_dimm_attr[chan]);
(struct attribute *)
dynamic_csrow_dimm_attr[chan]);
if (!err) {
/* create the CE Count attribute file */
err = sysfs_create_file(kobj,
(struct attribute *)dynamic_csrow_ce_count_attr[chan]);
(struct attribute *)
dynamic_csrow_ce_count_attr[chan]);
} else {
debugf1("%s() dimm labels and ce_count files created",
__func__);
@ -546,10 +501,8 @@ static struct kobj_type ktype_csrow = {
};
/* Create a CSROW object under specifed edac_mc_device */
static int edac_create_csrow_object(
struct kobject *edac_mci_kobj,
struct csrow_info *csrow,
int index)
static int edac_create_csrow_object(struct kobject *edac_mci_kobj,
struct csrow_info *csrow, int index)
{
int err = 0;
int chan;
@ -767,7 +720,7 @@ MCIDEV_ATTR(ue_count,S_IRUGO,mci_ue_count_show,NULL);
MCIDEV_ATTR(ce_count, S_IRUGO, mci_ce_count_show, NULL);
/* memory scrubber attribute file */
MCIDEV_ATTR(sdram_scrub_rate,S_IRUGO|S_IWUSR,mci_sdram_scrub_rate_show,\
MCIDEV_ATTR(sdram_scrub_rate, S_IRUGO | S_IWUSR, mci_sdram_scrub_rate_show,
mci_sdram_scrub_rate_store);
static struct mcidev_attribute *mci_attr[] = {
@ -801,7 +754,6 @@ static struct kobj_type ktype_mci = {
.default_attrs = (struct attribute **)mci_attr,
};
#define EDAC_DEVICE_SYMLINK "device"
/*
@ -898,5 +850,3 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
kobject_unregister(&mci->edac_mci_kobj);
wait_for_completion(&mci->kobj_complete);
}

View file

@ -133,7 +133,6 @@ static void edac_workqueue_teardown(void)
}
}
/*
* edac_init
* module initialization entry point
@ -220,4 +219,3 @@ MODULE_DESCRIPTION("Core library routines for EDAC reporting");
module_param(edac_debug_level, int, 0644);
MODULE_PARM_DESC(edac_debug_level, "Debug level");
#endif

View file

@ -42,10 +42,8 @@ extern struct workqueue_struct *edac_workqueue;
extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
unsigned msec);
extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev);
extern void edac_device_reset_delay_period(
struct edac_device_ctl_info *edac_dev,
unsigned long value);
extern void edac_device_reset_delay_period(struct edac_device_ctl_info
*edac_dev, unsigned long value);
/*
* EDAC PCI functions
@ -67,6 +65,4 @@ extern int edac_pci_get_poll_msec(void);
#define edac_pci_get_poll_msec()
#endif /* CONFIG_PCI */
#endif /* __EDAC_MODULE_H__ */

View file

@ -46,8 +46,7 @@ static inline void edac_unlock_pci_list(void)
* structure. The chip driver will allocate one of these for each
* edac_pci it is going to control/register with the EDAC CORE.
*/
struct edac_pci_ctl_info * edac_pci_alloc_ctl_info(
unsigned int sz_pvt,
struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt,
const char *edac_pci_name)
{
struct edac_pci_ctl_info *pci;
@ -71,6 +70,7 @@ struct edac_pci_ctl_info * edac_pci_alloc_ctl_info(
return pci;
}
EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info);
/*
@ -81,6 +81,7 @@ void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci)
{
kfree(pci);
}
EXPORT_SYMBOL_GPL(edac_pci_free_ctl_info);
/*
@ -149,7 +150,8 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci)
fail1:
edac_printk(KERN_WARNING, EDAC_PCI,
"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;
}
@ -205,6 +207,7 @@ struct edac_pci_ctl_info * edac_pci_find(int idx)
return NULL;
}
EXPORT_SYMBOL_GPL(edac_pci_find);
/*
@ -225,8 +228,7 @@ static void edac_pci_workq_function(void *ptr)
edac_lock_pci_list();
if ((pci->op_state == OP_RUNNING_POLL) &&
(pci->edac_check != NULL) &&
(edac_pci_get_check_errors()))
(pci->edac_check != NULL) && (edac_pci_get_check_errors()))
pci->edac_check(pci);
edac_unlock_pci_list();
@ -282,6 +284,7 @@ void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
edac_unlock_pci_list();
}
EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
/*
@ -328,8 +331,7 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx)
" DEV '%s' (%s)\n",
pci->mod_name,
pci->ctl_name,
dev_name(pci),
edac_op_state_toString(pci->op_state));
dev_name(pci), edac_op_state_toString(pci->op_state));
edac_unlock_pci_list();
return 0;
@ -340,6 +342,7 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx)
edac_unlock_pci_list();
return 1;
}
EXPORT_SYMBOL_GPL(edac_pci_add_device);
/*
@ -380,13 +383,11 @@ struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev)
edac_printk(KERN_INFO, EDAC_PCI,
"Removed device %d for %s %s: DEV %s\n",
pci->pci_idx,
pci->mod_name,
pci->ctl_name,
dev_name(pci));
pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci));
return pci;
}
EXPORT_SYMBOL_GPL(edac_pci_del_device);
void edac_pci_generic_check(struct edac_pci_ctl_info *pci)
@ -401,8 +402,8 @@ struct edac_pci_gen_data {
int edac_idx;
};
struct edac_pci_ctl_info *
edac_pci_create_generic_ctl(struct device *dev, const char *mod_name)
struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev,
const char *mod_name)
{
struct edac_pci_ctl_info *pci;
struct edac_pci_gen_data *pdata;
@ -430,6 +431,7 @@ edac_pci_create_generic_ctl(struct device *dev, const char *mod_name)
return pci;
}
EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl);
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_free_ctl_info(pci);
}
EXPORT_SYMBOL_GPL(edac_pci_release_generic_ctl);

View file

@ -13,7 +13,6 @@
#include "edac_core.h"
#include "edac_module.h"
#ifdef CONFIG_PCI
#define EDAC_PCI_SYMLINK "device"
@ -90,8 +89,7 @@ struct instance_attribute {
/* Function to 'show' fields from the edac_pci 'instance' structure */
static ssize_t edac_pci_instance_show(struct kobject *kobj,
struct attribute *attr,
char *buffer)
struct attribute *attr, char *buffer)
{
struct edac_pci_ctl_info *pci = to_instance(kobj);
struct instance_attribute *instance_attr = to_instance_attr(attr);
@ -101,7 +99,6 @@ static ssize_t edac_pci_instance_show(struct kobject *kobj,
return -EIO;
}
/* Function to 'store' fields into the edac_pci 'instance' structure */
static ssize_t edac_pci_instance_store(struct kobject *kobj,
struct attribute *attr,
@ -215,7 +212,8 @@ static ssize_t edac_pci_dev_show(struct kobject *kobj, struct attribute *attr,
}
static ssize_t edac_pci_dev_store(struct kobject *kobj,
struct attribute *attr, const char *buffer, size_t count)
struct attribute *attr, const char *buffer,
size_t count)
{
struct edac_pci_dev_attribute *edac_pci_dev;
edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
@ -359,12 +357,9 @@ int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci)
edac_pci_unregister_main_kobj();
}
debugf0("%s() idx=%d\n", __func__, pci->pci_idx);
err = sysfs_create_link(edac_kobj,
&pci->dev->kobj,
EDAC_PCI_SYMLINK);
err = sysfs_create_link(edac_kobj, &pci->dev->kobj, EDAC_PCI_SYMLINK);
if (err) {
debugf0("%s() sysfs_create_link() returned err= %d\n",
__func__, err);
@ -485,8 +480,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
/* On bridges, need to examine secondary status register */
status = get_pci_parity_status(dev, 1);
debugf2("PCI SEC_STATUS= 0x%04x %s\n",
status, dev->dev.bus_id );
debugf2("PCI SEC_STATUS= 0x%04x %s\n", status, dev->dev.bus_id);
/* check the secondary status reg for errors */
if (status) {
@ -590,6 +584,7 @@ void edac_pci_handle_pe(struct edac_pci_ctl_info *pci, const char *msg)
*/
edac_pci_do_parity_check();
}
EXPORT_SYMBOL_GPL(edac_pci_handle_pe);
void edac_pci_handle_npe(struct edac_pci_ctl_info *pci, const char *msg)
@ -609,6 +604,7 @@ void edac_pci_handle_npe(struct edac_pci_ctl_info *pci, const char *msg)
*/
edac_pci_do_parity_check();
}
EXPORT_SYMBOL_GPL(edac_pci_handle_npe);
/*

View file

@ -30,6 +30,7 @@ inline int edac_handler_set(void)
return atomic_read(&edac_handlers);
}
EXPORT_SYMBOL(edac_handler_set);
/*
@ -39,4 +40,5 @@ inline void edac_atomic_assert_error(void)
{
edac_err_assert++;
}
EXPORT_SYMBOL(edac_atomic_assert_error);