Commit 052dfb45 authored by Douglas Thompson's avatar Douglas Thompson Committed by Linus Torvalds

drivers/edac: cleanup spaces-gotos after Lindent messup

This patch fixes some remnant spaces inserted by the use of Lindent.
Seems Lindent adds some spaces when it shoulded. These have been fixed.
In addition, goto targets have issues, these have been fixed
in this patch.
Signed-off-by: default avatarDouglas Thompson <dougthompson@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6bc78404
......@@ -86,9 +86,9 @@ struct amd76x_dev_info {
static const struct amd76x_dev_info amd76x_devs[] = {
[AMD761] = {
.ctl_name = "AMD761"},
.ctl_name = "AMD761"},
[AMD762] = {
.ctl_name = "AMD762"},
.ctl_name = "AMD762"},
};
static struct edac_pci_ctl_info *amd76x_pci;
......@@ -102,13 +102,13 @@ static struct edac_pci_ctl_info *amd76x_pci;
* on the chip so that further errors will be reported
*/
static void amd76x_get_error_info(struct mem_ctl_info *mci,
struct amd76x_error_info *info)
struct amd76x_error_info *info)
{
struct pci_dev *pdev;
pdev = to_pci_dev(mci->dev);
pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS,
&info->ecc_mode_status);
&info->ecc_mode_status);
if (info->ecc_mode_status & BIT(8))
pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS,
......@@ -130,8 +130,8 @@ static void amd76x_get_error_info(struct mem_ctl_info *mci,
* then attempt to handle and clean up after the error
*/
static int amd76x_process_error_info(struct mem_ctl_info *mci,
struct amd76x_error_info *info,
int handle_errors)
struct amd76x_error_info *info,
int handle_errors)
{
int error_found;
u32 row;
......@@ -147,7 +147,7 @@ static int amd76x_process_error_info(struct mem_ctl_info *mci,
if (handle_errors) {
row = (info->ecc_mode_status >> 4) & 0xf;
edac_mc_handle_ue(mci, mci->csrows[row].first_page, 0,
row, mci->ctl_name);
row, mci->ctl_name);
}
}
......@@ -160,7 +160,7 @@ static int amd76x_process_error_info(struct mem_ctl_info *mci,
if (handle_errors) {
row = info->ecc_mode_status & 0xf;
edac_mc_handle_ce(mci, mci->csrows[row].first_page, 0,
0, row, 0, mci->ctl_name);
0, row, 0, mci->ctl_name);
}
}
......@@ -183,7 +183,7 @@ static void amd76x_check(struct mem_ctl_info *mci)
}
static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
enum edac_type edac_mode)
enum edac_type edac_mode)
{
struct csrow_info *csrow;
u32 mba, mba_base, mba_mask, dms;
......@@ -194,7 +194,7 @@ static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
/* find the DRAM Chip Select Base address and mask */
pci_read_config_dword(pdev,
AMD76X_MEM_BASE_ADDR + (index * 4), &mba);
AMD76X_MEM_BASE_ADDR + (index * 4), &mba);
if (!(mba & BIT(0)))
continue;
......@@ -249,7 +249,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
mci->mtype_cap = MEM_FLAG_RDDR;
mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
mci->edac_cap = ems_mode ?
(EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE;
(EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE;
mci->mod_name = EDAC_MOD_STR;
mci->mod_ver = AMD76X_REVISION;
mci->ctl_name = amd76x_devs[dev_idx].ctl_name;
......@@ -283,14 +283,14 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
debugf3("%s(): success\n", __func__);
return 0;
fail:
fail:
edac_mc_free(mci);
return -ENODEV;
}
/* returns count (>= 0), or negative on error */
static int __devinit amd76x_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
const struct pci_device_id *ent)
{
debugf0("%s()\n", __func__);
......
This diff is collapsed.
......@@ -148,17 +148,17 @@ static struct edac_pci_ctl_info *e7xxx_pci;
static const struct e7xxx_dev_info e7xxx_devs[] = {
[E7500] = {
.err_dev = PCI_DEVICE_ID_INTEL_7500_1_ERR,
.ctl_name = "E7500"},
.err_dev = PCI_DEVICE_ID_INTEL_7500_1_ERR,
.ctl_name = "E7500"},
[E7501] = {
.err_dev = PCI_DEVICE_ID_INTEL_7501_1_ERR,
.ctl_name = "E7501"},
.err_dev = PCI_DEVICE_ID_INTEL_7501_1_ERR,
.ctl_name = "E7501"},
[E7505] = {
.err_dev = PCI_DEVICE_ID_INTEL_7505_1_ERR,
.ctl_name = "E7505"},
.err_dev = PCI_DEVICE_ID_INTEL_7505_1_ERR,
.ctl_name = "E7505"},
[E7205] = {
.err_dev = PCI_DEVICE_ID_INTEL_7205_1_ERR,
.ctl_name = "E7205"},
.err_dev = PCI_DEVICE_ID_INTEL_7205_1_ERR,
.ctl_name = "E7205"},
};
/* FIXME - is this valid for both SECDED and S4ECD4ED? */
......@@ -179,7 +179,7 @@ static inline int e7xxx_find_channel(u16 syndrome)
}
static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
unsigned long page)
unsigned long page)
{
u32 remap;
struct e7xxx_pvt *pvt = (struct e7xxx_pvt *)mci->pvt_info;
......@@ -187,7 +187,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
debugf3("%s()\n", __func__);
if ((page < pvt->tolm) ||
((page >= 0x100000) && (page < pvt->remapbase)))
((page >= 0x100000) && (page < pvt->remapbase)))
return page;
remap = (page - pvt->tolm) + pvt->remapbase;
......@@ -257,15 +257,15 @@ static void e7xxx_get_error_info(struct mem_ctl_info *mci,
if ((info->dram_ferr & 1) || (info->dram_nerr & 1)) {
pci_read_config_dword(pvt->bridge_ck, E7XXX_DRAM_CELOG_ADD,
&info->dram_celog_add);
&info->dram_celog_add);
pci_read_config_word(pvt->bridge_ck,
E7XXX_DRAM_CELOG_SYNDROME,
&info->dram_celog_syndrome);
E7XXX_DRAM_CELOG_SYNDROME,
&info->dram_celog_syndrome);
}
if ((info->dram_ferr & 2) || (info->dram_nerr & 2))
pci_read_config_dword(pvt->bridge_ck, E7XXX_DRAM_UELOG_ADD,
&info->dram_uelog_add);
&info->dram_uelog_add);
if (info->dram_ferr & 3)
pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_FERR, 0x03, 0x03);
......@@ -275,8 +275,8 @@ static void e7xxx_get_error_info(struct mem_ctl_info *mci,
}
static int e7xxx_process_error_info(struct mem_ctl_info *mci,
struct e7xxx_error_info *info,
int handle_errors)
struct e7xxx_error_info *info,
int handle_errors)
{
int error_found;
......@@ -345,7 +345,7 @@ static inline int drb_granularity(u32 drc, int dev_idx)
}
static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
int dev_idx, u32 drc)
int dev_idx, u32 drc)
{
unsigned long last_cumul_size;
int index;
......@@ -435,7 +435,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
debugf3("%s(): init mci\n", __func__);
mci->mtype_cap = MEM_FLAG_RDDR;
mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED |
EDAC_FLAG_S4ECD4ED;
EDAC_FLAG_S4ECD4ED;
/* FIXME - what if different memory types are in different csrows? */
mci->mod_name = EDAC_MOD_STR;
mci->mod_ver = E7XXX_REVISION;
......@@ -448,8 +448,8 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
if (!pvt->bridge_ck) {
e7xxx_printk(KERN_ERR, "error reporting device not found:"
"vendor %x device 0x%x (broken BIOS?)\n",
PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev);
"vendor %x device 0x%x (broken BIOS?)\n",
PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev);
goto fail0;
}
......@@ -469,8 +469,8 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
pci_read_config_word(pdev, E7XXX_REMAPLIMIT, &pci_data);
pvt->remaplimit = ((u32) pci_data) << 14;
e7xxx_printk(KERN_INFO,
"tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm,
pvt->remapbase, pvt->remaplimit);
"tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm,
pvt->remapbase, pvt->remaplimit);
/* clear any pending errors, or initial state bits */
e7xxx_get_error_info(mci, &discard);
......@@ -498,10 +498,10 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
debugf3("%s(): success\n", __func__);
return 0;
fail1:
fail1:
pci_dev_put(pvt->bridge_ck);
fail0:
fail0:
edac_mc_free(mci);
return -ENODEV;
......@@ -509,13 +509,13 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
/* returns count (>= 0), or negative on error */
static int __devinit e7xxx_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
const struct pci_device_id *ent)
{
debugf0("%s()\n", __func__);
/* wake up and enable device */
return pci_enable_device(pdev) ?
-EIO : e7xxx_probe1(pdev, ent->driver_data);
-EIO : e7xxx_probe1(pdev, ent->driver_data);
}
static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
......@@ -578,7 +578,7 @@ module_exit(e7xxx_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Linux Networx (http://lnxi.com) Thayne Harbaugh et al\n"
"Based on.work by Dan Hollis et al");
"Based on.work by Dan Hollis et al");
MODULE_DESCRIPTION("MC support for Intel e7xxx memory controllers");
module_param(edac_op_state, int, 0444);
MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
......@@ -94,16 +94,16 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
/* Calc the 'end' offset past the ctl_info structure */
dev_inst = (struct edac_device_instance *)
edac_align_ptr(&dev_ctl[1], sizeof(*dev_inst));
edac_align_ptr(&dev_ctl[1], sizeof(*dev_inst));
/* Calc the 'end' offset past the instance array */
dev_blk = (struct edac_device_block *)
edac_align_ptr(&dev_inst[nr_instances], sizeof(*dev_blk));
edac_align_ptr(&dev_inst[nr_instances], sizeof(*dev_blk));
/* Calc the 'end' offset past the dev_blk array */
count = nr_instances * nr_blocks;
dev_attrib = (struct edac_attrib *)
edac_align_ptr(&dev_blk[count], sizeof(*dev_attrib));
edac_align_ptr(&dev_blk[count], sizeof(*dev_attrib));
/* Check for case of NO attributes specified */
if (nr_attribs > 0)
......@@ -121,11 +121,11 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
* rather than an imaginary chunk of memory located at address 0.
*/
dev_inst = (struct edac_device_instance *)
(((char *)dev_ctl) + ((unsigned long)dev_inst));
(((char *)dev_ctl) + ((unsigned long)dev_inst));
dev_blk = (struct edac_device_block *)
(((char *)dev_ctl) + ((unsigned long)dev_blk));
(((char *)dev_ctl) + ((unsigned long)dev_blk));
dev_attrib = (struct edac_attrib *)
(((char *)dev_ctl) + ((unsigned long)dev_attrib));
(((char *)dev_ctl) + ((unsigned long)dev_attrib));
pvt = sz_private ? (((char *)dev_ctl) + ((unsigned long)pvt)) : NULL;
memset(dev_ctl, 0, total_size); /* clear all fields */
......@@ -257,18 +257,18 @@ static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev)
list_add_tail_rcu(&edac_dev->link, insert_before);
return 0;
fail0:
fail0:
edac_printk(KERN_WARNING, EDAC_MC,
"%s (%s) %s %s already assigned %d\n",
rover->dev->bus_id, dev_name(rover),
rover->mod_name, rover->ctl_name, rover->dev_idx);
"%s (%s) %s %s already assigned %d\n",
rover->dev->bus_id, dev_name(rover),
rover->mod_name, rover->ctl_name, rover->dev_idx);
return 1;
fail1:
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__);
"bug in low-level driver: attempt to assign\n"
" duplicate dev_idx %d in %s()\n", rover->dev_idx,
__func__);
return 1;
}
......@@ -288,7 +288,7 @@ 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)
*edac_device)
{
list_del_rcu(&edac_device->link);
init_completion(&edac_device->complete);
......@@ -342,8 +342,8 @@ static void edac_device_workq_function(struct work_struct *work_req)
/* Only poll controllers that are running polled and have a check */
if ((edac_dev->op_state == OP_RUNNING_POLL) &&
(edac_dev->edac_check != NULL)) {
edac_dev->edac_check(edac_dev);
(edac_dev->edac_check != NULL)) {
edac_dev->edac_check(edac_dev);
}
unlock_device_list();
......@@ -358,7 +358,7 @@ static void edac_device_workq_function(struct work_struct *work_req)
* passing in the new delay period in msec
*/
void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
unsigned msec)
unsigned msec)
{
debugf0("%s()\n", __func__);
......@@ -389,7 +389,7 @@ void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
*/
void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
unsigned long value)
unsigned long value)
{
lock_device_list();
......@@ -434,7 +434,7 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx)
/* create this instance's sysfs entries */
if (edac_device_create_sysfs(edac_dev)) {
edac_device_printk(edac_dev, KERN_WARNING,
"failed to create sysfs device\n");
"failed to create sysfs device\n");
goto fail1;
}
......@@ -454,21 +454,21 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx)
/* Report action taken */
edac_device_printk(edac_dev, KERN_INFO,
"Giving out device to module '%s' controller '%s': DEV '%s' (%s)\n",
edac_dev->mod_name,
edac_dev->ctl_name,
dev_name(edac_dev),
edac_op_state_toString(edac_dev->op_state)
);
"Giving out device to module '%s' controller "
"'%s': DEV '%s' (%s)\n",
edac_dev->mod_name,
edac_dev->ctl_name,
dev_name(edac_dev),
edac_op_state_toString(edac_dev->op_state));
unlock_device_list();
return 0;
fail1:
fail1:
/* Some error, so remove the entry from the lsit */
del_edac_device_from_global_list(edac_dev);
fail0:
fail0:
unlock_device_list();
return 1;
}
......@@ -516,9 +516,9 @@ struct edac_device_ctl_info *edac_device_del_device(struct device *dev)
unlock_device_list();
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));
"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));
return edac_dev;
}
......@@ -536,7 +536,7 @@ static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
}
static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info
*edac_dev)
*edac_dev)
{
return edac_dev->panic_on_ue;
}
......@@ -546,16 +546,16 @@ static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info
* perform a common output and handling of an 'edac_dev' CE event
*/
void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
int inst_nr, int block_nr, const char *msg)
int inst_nr, int block_nr, const char *msg)
{
struct edac_device_instance *instance;
struct edac_device_block *block = NULL;
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);
"INTERNAL ERROR: 'instance' out of range "
"(%d >= %d)\n", inst_nr,
edac_dev->nr_instances);
return;
}
......@@ -563,9 +563,10 @@ 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);
"INTERNAL ERROR: instance %d 'block' "
"out of range (%d >= %d)\n",
inst_nr, block_nr,
instance->nr_blocks);
return;
}
......@@ -580,9 +581,9 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
if (edac_device_get_log_ce(edac_dev))
edac_device_printk(edac_dev, KERN_WARNING,
"CE: %s instance: %s block: %s '%s'\n",
edac_dev->ctl_name, instance->name,
block ? block->name : "N/A", msg);
"CE: %s instance: %s block: %s '%s'\n",
edac_dev->ctl_name, instance->name,
block ? block->name : "N/A", msg);
}
EXPORT_SYMBOL_GPL(edac_device_handle_ce);
......@@ -592,16 +593,16 @@ EXPORT_SYMBOL_GPL(edac_device_handle_ce);
* perform a common output and handling of an 'edac_dev' UE event
*/
void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
int inst_nr, int block_nr, const char *msg)
int inst_nr, int block_nr, const char *msg)
{
struct edac_device_instance *instance;
struct edac_device_block *block = NULL;
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);
"INTERNAL ERROR: 'instance' out of range "
"(%d >= %d)\n", inst_nr,
edac_dev->nr_instances);
return;
}
......@@ -609,9 +610,10 @@ 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);
"INTERNAL ERROR: instance %d 'block' "
"out of range (%d >= %d)\n",
inst_nr, block_nr,
instance->nr_blocks);
return;
}
......@@ -626,14 +628,14 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
if (edac_device_get_log_ue(edac_dev))
edac_device_printk(edac_dev, KERN_EMERG,
"UE: %s instance: %s block: %s '%s'\n",
edac_dev->ctl_name, instance->name,
block ? block->name : "N/A", msg);
"UE: %s instance: %s block: %s '%s'\n",
edac_dev->ctl_name, instance->name,
block ? block->name : "N/A", msg);
if (edac_device_get_panic_on_ue(edac_dev))
panic("EDAC %s: UE instance: %s block %s '%s'\n",
edac_dev->ctl_name, instance->name,
block ? block->name : "N/A", msg);
edac_dev->ctl_name, instance->name,
block ? block->name : "N/A", msg);
}
EXPORT_SYMBOL_GPL(edac_device_handle_ue);
......@@ -27,14 +27,14 @@
/* 'log_ue' */
static ssize_t edac_device_ctl_log_ue_show(struct edac_device_ctl_info
*ctl_info, char *data)
*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)
*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);
......@@ -44,14 +44,14 @@ static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info
/* 'log_ce' */
static ssize_t edac_device_ctl_log_ce_show(struct edac_device_ctl_info
*ctl_info, char *data)
*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)
*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);
......@@ -78,14 +78,14 @@ static ssize_t edac_device_ctl_panic_on_ue_store(struct edac_device_ctl_info
/* 'poll_msec' show and store functions*/
static ssize_t edac_device_ctl_poll_msec_show(struct edac_device_ctl_info
*ctl_info, char *data)
*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)
*ctl_info, const char *data,
size_t count)
{
unsigned long value;
......@@ -112,7 +112,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);
......@@ -124,8 +124,8 @@ static ssize_t edac_dev_ctl_info_show(struct kobject *kobj,
/* Function to 'store' fields into the edac_dev 'ctl_info' structure */
static ssize_t edac_dev_ctl_info_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer, size_t count)
struct attribute *attr,
const char *buffer, size_t count)
{
struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj);
struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr);
......@@ -143,21 +143,21 @@ static struct sysfs_ops device_ctl_info_ops = {
#define CTL_INFO_ATTR(_name,_mode,_show,_store) \
static struct ctl_info_attribute attr_ctl_info_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.store = _store, \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.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);
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[] = {
......@@ -242,7 +242,7 @@ static int edac_device_register_main_kobj(struct edac_device_ctl_info *edac_dev)
* the '..../edac/<name>' kobject
*/
static void edac_device_unregister_main_kobj(struct edac_device_ctl_info
*edac_dev)
*edac_dev)
{
debugf0("%s()\n", __func__);
debugf1("%s() name of kobject is: %s\n",
......@@ -264,13 +264,13 @@ static void edac_device_unregister_main_kobj(struct edac_device_ctl_info
* Set of low-level instance attribute show functions
*/
static ssize_t instance_ue_count_show(struct edac_device_instance *instance,
char *data)
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)
char *data)
{
return sprintf(data, "%u\n", instance->counters.ce_count);
}
......@@ -298,7 +298,7 @@ struct instance_attribute {
/* 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);
......@@ -310,8 +310,8 @@ static ssize_t edac_dev_instance_show(struct kobject *kobj,
/* Function to 'store' fields into the edac_dev 'instance' structure */
static ssize_t edac_dev_instance_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer, size_t count)
struct attribute *attr,
const char *buffer, size_t count)
{
struct edac_device_instance *instance = to_instance(kobj);
struct instance_attribute *instance_attr = to_instance_attr(attr);
......@@ -329,9 +329,9 @@ static struct sysfs_ops device_instance_ops = {
#define INSTANCE_ATTR(_name,_mode,_show,_store) \
static struct instance_attribute attr_instance_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.store = _store, \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.store = _store, \
};
/*
......@@ -394,7 +394,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);
......@@ -406,8 +406,8 @@ static ssize_t edac_dev_block_show(struct kobject *kobj,
/* Function to 'store' fields into the edac_dev 'block' structure */
static ssize_t edac_dev_block_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer, size_t count)
struct attribute *attr,
const char *buffer, size_t count)
{
struct edac_device_block *block = to_block(kobj);
struct block_attribute *block_attr = to_block_attr(attr);
......@@ -425,9 +425,9 @@ static struct sysfs_ops device_block_ops = {
#define BLOCK_ATTR(_name,_mode,_show,_store) \
static struct block_attribute attr_block_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.store = _store, \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.store = _store, \
};
BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
......@@ -453,8 +453,8 @@ static struct kobj_type ktype_block_ctrl = {
* edac_device_create_block
*/
static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
struct edac_device_instance *instance,
int idx)
struct edac_device_instance *instance,
int idx)
{
int err;
struct edac_device_block *block;
......@@ -487,8 +487,8 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
* edac_device_delete_block(edac_dev,j);
*/
static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
struct edac_device_instance *instance,
int idx)
struct edac_device_instance *instance,
int idx)
{
struct edac_device_block *block;
......@@ -507,7 +507,7 @@ static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
* create just one instance of an edac_device 'instance'
*/
static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
int idx)
int idx)
{
int i, j;
int err;
......@@ -627,22 +627,22 @@ static int edac_device_add_sysfs_attributes(
struct edac_device_ctl_info *edac_dev)
{
int err;
struct edac_dev_sysfs_attribute *sysfs_attrib;
/* point to the start of the array and iterate over it
* adding each attribute listed to this mci instance's kobject
*/
sysfs_attrib = edac_dev->sysfs_attributes;
while (sysfs_attrib->attr.name != NULL) {
err = sysfs_create_file(&edac_dev->kobj,
(struct attribute*) sysfs_attrib);
if (err) {
return err;
}
sysfs_attrib++;
}
struct edac_dev_sysfs_attribute *sysfs_attrib;
/* point to the start of the array and iterate over it
* adding each attribute listed to this mci instance's kobject
*/
sysfs_attrib = edac_dev->sysfs_attributes;
while (sysfs_attrib->attr.name != NULL) {
err = sysfs_create_file(&edac_dev->kobj,
(struct attribute*) sysfs_attrib);
if (err) {
return err;
}
sysfs_attrib++;
}
return 0;
}
......
This diff is collapsed.
......@@ -183,16 +183,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[] = {
......@@ -281,44 +281,44 @@ void edac_sysfs_memctrl_teardown(void)
/* Set of more default csrow<id> attribute show/store functions */
static ssize_t csrow_ue_count_show(struct csrow_info *csrow, char *data,
int private)
int private)
{
return sprintf(data, "%u\n", csrow->ue_count);
}
static ssize_t csrow_ce_count_show(struct csrow_info *csrow, char *data,
int private)
int private)
{
return sprintf(data, "%u\n", csrow->ce_count);
}
static ssize_t csrow_size_show(struct csrow_info *csrow, char *data,
int private)
int private)
{
return sprintf(data, "%u\n", PAGES_TO_MiB(csrow->nr_pages));
}
static ssize_t csrow_mem_type_show(struct csrow_info *csrow, char *data,
int private)
int private)
{
return sprintf(data, "%s\n", mem_types[csrow->mtype]);
}
static ssize_t csrow_dev_type_show(struct csrow_info *csrow, char *data,
int private)
int private)
{
return sprintf(data, "%s\n", dev_types[csrow->dtype]);
}
static ssize_t csrow_edac_mode_show(struct csrow_info *csrow, char *data,
int private)
int private)
{
return sprintf(data, "%s\n", edac_caps[csrow->edac_mode]);
}
/* show/store functions for DIMM Label attributes */
static ssize_t channel_dimm_label_show(struct csrow_info *csrow,
char *data, int channel)
char *data, int channel)
{
return snprintf(data, EDAC_MC_LABEL_LEN, "%s",
csrow->channels[channel].label);
......@@ -339,7 +339,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);
}
......@@ -357,27 +357,27 @@ 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;
}
static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr,
const char *buffer, size_t count)
const char *buffer, size_t count)
{
struct csrow_info *csrow = to_csrow(kobj);
struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr);
if (csrowdev_attr->store)
return csrowdev_attr->store(csrow,
buffer,
count, csrowdev_attr->private);
buffer,
count, csrowdev_attr->private);
return -EIO;
}
......@@ -415,17 +415,17 @@ static struct csrowdev_attribute *default_csrow_attr[] = {
/* 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[] = {
......@@ -501,7 +501,7 @@ 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)
struct csrow_info *csrow, int index)
{
int err = 0;
int chan;
......@@ -531,7 +531,7 @@ static int edac_create_csrow_object(struct kobject *edac_mci_kobj,
}
}
error_exit:
error_exit:
return err;
}
......@@ -563,7 +563,7 @@ static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci,
/* memory scrubbing */
static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci,
const char *data, size_t count)
const char *data, size_t count)
{
u32 bandwidth = -1;
......@@ -573,18 +573,18 @@ static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci,
if (!(*mci->set_sdram_scrub_rate) (mci, &bandwidth)) {
edac_printk(KERN_DEBUG, EDAC_MC,
"Scrub rate set successfully, applied: %d\n",
bandwidth);
"Scrub rate set successfully, applied: %d\n",
bandwidth);
} else {
/* FIXME: error codes maybe? */
edac_printk(KERN_DEBUG, EDAC_MC,
"Scrub rate set FAILED, could not apply: %d\n",
bandwidth);
"Scrub rate set FAILED, could not apply: %d\n",
bandwidth);
}
} else {
/* FIXME: produce "not implemented" ERROR for user-side. */
edac_printk(KERN_WARNING, EDAC_MC,
"Memory scrubbing 'set'control is not implemented!\n");
"Memory scrubbing 'set'control is not implemented!\n");
}
return count;
}
......@@ -596,18 +596,18 @@ static ssize_t mci_sdram_scrub_rate_show(struct mem_ctl_info *mci, char *data)
if (mci->get_sdram_scrub_rate) {
if (!(*mci->get_sdram_scrub_rate) (mci, &bandwidth)) {
edac_printk(KERN_DEBUG, EDAC_MC,
"Scrub rate successfully, fetched: %d\n",
bandwidth);
"Scrub rate successfully, fetched: %d\n",
bandwidth);
} else {
/* FIXME: error codes maybe? */
edac_printk(KERN_DEBUG, EDAC_MC,
"Scrub rate fetch FAILED, got: %d\n",
bandwidth);
"Scrub rate fetch FAILED, got: %d\n",
bandwidth);
}
} else {
/* FIXME: produce "not implemented" ERROR for user-side. */
edac_printk(KERN_WARNING, EDAC_MC,
"Memory scrubbing 'get' control is not implemented\n");
"Memory scrubbing 'get' control is not implemented\n");
}
return sprintf(data, "%d\n", bandwidth);
}
......@@ -648,7 +648,7 @@ static ssize_t mci_size_mb_show(struct mem_ctl_info *mci, char *data)
int total_pages, csrow_idx;
for (total_pages = csrow_idx = 0; csrow_idx < mci->nr_csrows;
csrow_idx++) {
csrow_idx++) {
struct csrow_info *csrow = &mci->csrows[csrow_idx];
if (!csrow->nr_pages)
......@@ -665,7 +665,7 @@ static ssize_t mci_size_mb_show(struct mem_ctl_info *mci, char *data)
/* MCI show/store functions for top most object */
static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr,
char *buffer)
char *buffer)
{
struct mem_ctl_info *mem_ctl_info = to_mci(kobj);
struct mcidev_sysfs_attribute *mcidev_attr = to_mcidev_attr(attr);
......@@ -677,7 +677,7 @@ static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr,
}
static ssize_t mcidev_store(struct kobject *kobj, struct attribute *attr,
const char *buffer, size_t count)
const char *buffer, size_t count)
{
struct mem_ctl_info *mem_ctl_info = to_mci(kobj);
struct mcidev_sysfs_attribute *mcidev_attr = to_mcidev_attr(attr);
......@@ -714,7 +714,7 @@ 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,
mci_sdram_scrub_rate_store);
mci_sdram_scrub_rate_store);
static struct mcidev_sysfs_attribute *mci_attr[] = {
&mci_attr_reset_counters,
......@@ -841,7 +841,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
return 0;
/* CSROW error: backout what has already been registered, */
fail1:
fail1:
for (i--; i >= 0; i--) {
if (csrow->nr_pages > 0) {
init_completion(&csrow->kobj_complete);
......@@ -850,7 +850,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
}
}
fail0:
fail0:
init_completion(&mci->kobj_complete);
kobject_unregister(edac_mci_kobj);
wait_for_completion(&mci->kobj_complete);
......
......@@ -157,7 +157,7 @@ static int __init edac_init(void)
*/
if (edac_register_sysfs_edac_name()) {
edac_printk(KERN_ERR, EDAC_MC,
"Error initializing 'edac' kobject\n");
"Error initializing 'edac' kobject\n");
err = -ENODEV;
goto error;
}
......@@ -166,7 +166,7 @@ static int __init edac_init(void)
*/
if (edac_sysfs_memctrl_setup()) {
edac_printk(KERN_ERR, EDAC_MC,
"Error initializing sysfs code\n");
"Error initializing sysfs code\n");
err = -ENODEV;
goto error_sysfs;
}
......@@ -181,11 +181,11 @@ static int __init edac_init(void)
return 0;
/* Error teardown stack */
error_mem:
error_mem:
edac_sysfs_memctrl_teardown();
error_sysfs:
error_sysfs:
edac_unregister_sysfs_edac_name();
error:
error:
return err;
}
......
......@@ -47,7 +47,7 @@ static inline void edac_unlock_pci_list(void)
* 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,
const char *edac_pci_name)
const char *edac_pci_name)
{
struct edac_pci_ctl_info *pci;
void *pvt;
......@@ -140,18 +140,18 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci)
list_add_tail_rcu(&pci->link, insert_before);
return 0;
fail0:
fail0:
edac_printk(KERN_WARNING, EDAC_PCI,
"%s (%s) %s %s already assigned %d\n",
rover->dev->bus_id, dev_name(rover),
rover->mod_name, rover->ctl_name, rover->pci_idx);
"%s (%s) %s %s already assigned %d\n",
rover->dev->bus_id, dev_name(rover),
rover->mod_name, rover->ctl_name, rover->pci_idx);
return 1;
fail1:
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__);
"but in low-level driver: attempt to assign\n"
"\tduplicate pci_idx %d in %s()\n", rover->pci_idx,
__func__);
return 1;
}
......@@ -222,14 +222,14 @@ static void edac_pci_workq_function(struct work_struct *work_req)
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();
/* Reschedule */
queue_delayed_work(edac_workqueue, &pci->work,
msecs_to_jiffies(edac_pci_get_poll_msec()));
msecs_to_jiffies(edac_pci_get_poll_msec()));
}
/*
......@@ -244,7 +244,7 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci,
INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function);
queue_delayed_work(edac_workqueue, &pci->work,
msecs_to_jiffies(edac_pci_get_poll_msec()));
msecs_to_jiffies(edac_pci_get_poll_msec()));
}
/*
......@@ -326,9 +326,9 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx)
edac_unlock_pci_list();
return 0;
fail1:
fail1:
del_edac_pci_from_global_list(pci);
fail0:
fail0:
edac_unlock_pci_list();
return 1;
}
......@@ -372,8 +372,8 @@ struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev)
edac_unlock_pci_list();
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));
"Removed device %d for %s %s: DEV %s\n",
pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci));
return pci;
}
......@@ -393,7 +393,7 @@ struct edac_pci_gen_data {
};
struct edac_pci_ctl_info *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_gen_data *pdata;
......
......@@ -61,7 +61,7 @@ static ssize_t instance_pe_count_show(struct edac_pci_ctl_info *pci, char *data)
}
static ssize_t instance_npe_count_show(struct edac_pci_ctl_info *pci,
char *data)
char *data)
{
return sprintf(data, "%u\n", atomic_read(&pci->counters.npe_count));
}
......@@ -89,7 +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,8 +101,8 @@ static ssize_t edac_pci_instance_show(struct kobject *kobj,
/* Function to 'store' fields into the edac_pci 'instance' structure */
static ssize_t edac_pci_instance_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_ctl_info *pci = to_instance(kobj);
struct instance_attribute *instance_attr = to_instance_attr(attr);
......@@ -212,8 +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;
......@@ -246,13 +246,13 @@ static struct edac_pci_dev_attribute edac_pci_attr_##_name = { \
/* PCI Parity control files */
EDAC_PCI_ATTR(check_pci_errors, S_IRUGO | S_IWUSR, edac_pci_int_show,
edac_pci_int_store);
edac_pci_int_store);
EDAC_PCI_ATTR(edac_pci_log_pe, S_IRUGO | S_IWUSR, edac_pci_int_show,
edac_pci_int_store);
edac_pci_int_store);
EDAC_PCI_ATTR(edac_pci_log_npe, S_IRUGO | S_IWUSR, edac_pci_int_show,
edac_pci_int_store);
edac_pci_int_store);
EDAC_PCI_ATTR(edac_pci_panic_on_pe, S_IRUGO | S_IWUSR, edac_pci_int_show,
edac_pci_int_store);
edac_pci_int_store);
EDAC_PCI_ATTR(pci_parity_count, S_IRUGO, edac_pci_int_show, NULL);
EDAC_PCI_ATTR(pci_nonparity_count, S_IRUGO, edac_pci_int_show, NULL);
......@@ -405,7 +405,7 @@ static u16 get_pci_parity_status(struct pci_dev *dev, int secondary)
}
status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR |
PCI_STATUS_PARITY;
PCI_STATUS_PARITY;
if (status)
/* reset only the bits we are interested in */
......@@ -449,23 +449,23 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
if (status) {
if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) {
edac_printk(KERN_CRIT, EDAC_PCI,
"Signaled System Error on %s\n",
pci_name(dev));
"Signaled System Error on %s\n",
pci_name(dev));
atomic_inc(&pci_nonparity_count);
}
if (status & (PCI_STATUS_PARITY)) {
edac_printk(KERN_CRIT, EDAC_PCI,
"Master Data Parity Error on %s\n",
pci_name(dev));
"Master Data Parity Error on %s\n",
pci_name(dev));
atomic_inc(&pci_parity_count);
}
if (status & (PCI_STATUS_DETECTED_PARITY)) {
edac_printk(KERN_CRIT, EDAC_PCI,
"Detected Parity Error on %s\n",
pci_name(dev));
"Detected Parity Error on %s\n",
pci_name(dev));
atomic_inc(&pci_parity_count);
}
......@@ -486,23 +486,23 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
if (status) {
if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) {
edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
"Signaled System Error on %s\n",
pci_name(dev));
"Signaled System Error on %s\n",
pci_name(dev));
atomic_inc(&pci_nonparity_count);
}
if (status & (PCI_STATUS_PARITY)) {
edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
"Master Data Parity Error on "
"%s\n", pci_name(dev));
"Master Data Parity Error on "
"%s\n", pci_name(dev));
atomic_inc(&pci_parity_count);
}
if (status & (PCI_STATUS_DETECTED_PARITY)) {
edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
"Detected Parity Error on %s\n",
pci_name(dev));
"Detected Parity Error on %s\n",
pci_name(dev));
atomic_inc(&pci_parity_count);
}
......
......@@ -148,7 +148,7 @@ struct i3000_error_info {
static const struct i3000_dev_info i3000_devs[] = {
[I3000] = {
.ctl_name = "i3000"},
.ctl_name = "i3000"},
};
static struct pci_dev *mci_pdev = NULL;
......@@ -195,8 +195,8 @@ static void i3000_get_error_info(struct mem_ctl_info *mci,
}
static int i3000_process_error_info(struct mem_ctl_info *mci,
struct i3000_error_info *info,
int handle_errors)
struct i3000_error_info *info,
int handle_errors)
{
int row, multi_chan;
int pfn, offset, channel;
......@@ -224,7 +224,7 @@ static int i3000_process_error_info(struct mem_ctl_info *mci,
edac_mc_handle_ue(mci, pfn, offset, row, "i3000 UE");
else
edac_mc_handle_ce(mci, pfn, offset, info->derrsyn, row,
multi_chan ? channel : 0, "i3000 CE");
multi_chan ? channel : 0, "i3000 CE");
return 1;
}
......@@ -250,7 +250,8 @@ static int i3000_is_interleaved(const unsigned char *c0dra,
*/
for (i = 0; i < I3000_RANKS_PER_CHANNEL / 2; i++)
if (ODD_RANK_ATTRIB(c0dra[i]) != ODD_RANK_ATTRIB(c1dra[i]) ||
EVEN_RANK_ATTRIB(c0dra[i]) != EVEN_RANK_ATTRIB(c1dra[i]))
EVEN_RANK_ATTRIB(c0dra[i]) !=
EVEN_RANK_ATTRIB(c1dra[i]))
return 0;
/* If the rank boundaries for the two channels are different
......@@ -283,7 +284,7 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
window = ioremap_nocache(mchbar, I3000_MMR_WINDOW_SIZE);
if (!window) {
printk(KERN_ERR "i3000: cannot map mmio space at 0x%lx\n",
mchbar);
mchbar);
return -ENODEV;
}
......@@ -398,7 +399,7 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
/* returns count (>= 0), or negative on error */
static int __devinit i3000_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
const struct pci_device_id *ent)
{
int rc;
......@@ -459,7 +460,7 @@ static int __init i3000_init(void)
if (mci_pdev == NULL) {
i3000_registered = 0;
mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_3000_HB, NULL);
PCI_DEVICE_ID_INTEL_3000_HB, NULL);
if (!mci_pdev) {
debugf0("i3000 pci_get_device fail\n");
pci_rc = -ENODEV;
......@@ -476,10 +477,10 @@ static int __init i3000_init(void)
return 0;
fail1:
fail1:
pci_unregister_driver(&i3000_driver);
fail0:
fail0:
if (mci_pdev)
pci_dev_put(mci_pdev);
......
This diff is collapsed.
......@@ -114,8 +114,8 @@ struct i82443bxgx_edacmc_error_info {
static struct edac_pci_ctl_info *i82443bxgx_pci;
static void i82443bxgx_edacmc_get_error_info(struct mem_ctl_info *mci,
struct i82443bxgx_edacmc_error_info
*info)
struct i82443bxgx_edacmc_error_info
*info)
{
struct pci_dev *pdev;
pdev = to_pci_dev(mci->dev);
......@@ -151,17 +151,18 @@ static int i82443bxgx_edacmc_process_error_info(struct mem_ctl_info *mci,
error_found = 1;
if (handle_errors)
edac_mc_handle_ce(mci, page, pageoffset,
/* 440BX/GX don't make syndrome information available */
0, edac_mc_find_csrow_by_page(mci, page), 0, /* channel */
mci->ctl_name);
/* 440BX/GX don't make syndrome information
* available */
0, edac_mc_find_csrow_by_page(mci, page), 0,
mci->ctl_name);
}
if (info->eap & I82443BXGX_EAP_OFFSET_MBE) {
error_found = 1;
if (handle_errors)
edac_mc_handle_ue(mci, page, pageoffset,
edac_mc_find_csrow_by_page(mci, page),
mci->ctl_name);
edac_mc_find_csrow_by_page(mci, page),
mci->ctl_name);
}
return error_found;
......@@ -177,9 +178,9 @@ static void i82443bxgx_edacmc_check(struct mem_ctl_info *mci)
}
static void i82443bxgx_init_csrows(struct mem_ctl_info *mci,
struct pci_dev *pdev,
enum edac_type edac_mode,
enum mem_type mtype)
struct pci_dev *pdev,
enum edac_type edac_mode,
enum mem_type mtype)
{
struct csrow_info *csrow;
int index;
......@@ -233,7 +234,8 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
debugf0("MC: " __FILE__ ": %s()\n", __func__);
/* Something is really hosed if PCI config space reads from
the MC aren't working. */
* the MC aren't working.
*/
if (pci_read_config_dword(pdev, I82443BXGX_NBXCFG, &nbxcfg))
return -EIO;
......@@ -258,8 +260,8 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
mtype = MEM_RDR;
break;
default:
debugf0
("Unknown/reserved DRAM type value in DRAMC register!\n");
debugf0("Unknown/reserved DRAM type value "
"in DRAMC register!\n");
mtype = -MEM_UNKNOWN;
}
......@@ -271,10 +273,10 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
mci->scrub_cap = SCRUB_FLAG_HW_SRC;
pci_read_config_dword(pdev, I82443BXGX_NBXCFG, &nbxcfg);
ecc_mode = ((nbxcfg >> I82443BXGX_NBXCFG_OFFSET_DRAM_INTEGRITY) &
(BIT(0) | BIT(1)));
(BIT(0) | BIT(1)));
mci->scrub_mode = (ecc_mode == I82443BXGX_NBXCFG_INTEGRITY_SCRUB)
? SCRUB_HW_SRC : SCRUB_NONE;
? SCRUB_HW_SRC : SCRUB_NONE;
switch (ecc_mode) {
case I82443BXGX_NBXCFG_INTEGRITY_NONE:
......@@ -288,9 +290,8 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
edac_mode = EDAC_SECDED;
break;
default:
debugf0
("%s(): Unknown/reserved ECC state in NBXCFG register!\n",
__func__);
debugf0("%s(): Unknown/reserved ECC state "
"in NBXCFG register!\n", __func__);
edac_mode = EDAC_UNKNOWN;
break;
}
......@@ -301,10 +302,10 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
* here, or we get "phantom" errors occuring at module-load
* time. */
pci_write_bits32(pdev, I82443BXGX_EAP,
(I82443BXGX_EAP_OFFSET_SBE |
I82443BXGX_EAP_OFFSET_MBE),
(I82443BXGX_EAP_OFFSET_SBE |
I82443BXGX_EAP_OFFSET_MBE));
(I82443BXGX_EAP_OFFSET_SBE |
I82443BXGX_EAP_OFFSET_MBE),
(I82443BXGX_EAP_OFFSET_SBE |
I82443BXGX_EAP_OFFSET_MBE));
mci->mod_name = EDAC_MOD_STR;
mci->mod_ver = I82443_REVISION;
......@@ -332,7 +333,7 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
debugf3("MC: " __FILE__ ": %s(): success\n", __func__);
return 0;
fail:
fail:
edac_mc_free(mci);
return -ENODEV;
}
......
......@@ -54,7 +54,7 @@ struct i82860_error_info {
static const struct i82860_dev_info i82860_devs[] = {
[I82860] = {
.ctl_name = "i82860"},
.ctl_name = "i82860"},
};
static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code
......@@ -63,7 +63,7 @@ static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code
static struct edac_pci_ctl_info *i82860_pci;
static void i82860_get_error_info(struct mem_ctl_info *mci,
struct i82860_error_info *info)
struct i82860_error_info *info)
{
struct pci_dev *pdev;
......@@ -96,8 +96,8 @@ static void i82860_get_error_info(struct mem_ctl_info *mci,
}
static int i82860_process_error_info(struct mem_ctl_info *mci,
struct i82860_error_info *info,
int handle_errors)
struct i82860_error_info *info,
int handle_errors)
{
int row;
......@@ -119,7 +119,7 @@ static int i82860_process_error_info(struct mem_ctl_info *mci,
edac_mc_handle_ue(mci, info->eap, 0, row, "i82860 UE");
else
edac_mc_handle_ce(mci, info->eap, 0, info->derrsyn, row, 0,
"i82860 UE");
"i82860 UE");
return 1;
}
......@@ -155,7 +155,7 @@ static void i82860_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev)
csrow = &mci->csrows[index];
pci_read_config_word(pdev, I82860_GBA + index * 2, &value);
cumul_size = (value & I82860_GBA_MASK) <<
(I82860_GBA_SHIFT - PAGE_SHIFT);
(I82860_GBA_SHIFT - PAGE_SHIFT);
debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
cumul_size);
......@@ -230,14 +230,14 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
return 0;
fail:
fail:
edac_mc_free(mci);
return -ENODEV;
}
/* returns count (>= 0), or negative on error */
static int __devinit i82860_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
const struct pci_device_id *ent)
{
int rc;
......@@ -299,7 +299,7 @@ static int __init i82860_init(void)
if (!mci_pdev) {
mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82860_0, NULL);
PCI_DEVICE_ID_INTEL_82860_0, NULL);
if (mci_pdev == NULL) {
debugf0("860 pci_get_device fail\n");
......@@ -318,10 +318,10 @@ static int __init i82860_init(void)
return 0;
fail1:
fail1:
pci_unregister_driver(&i82860_driver);
fail0:
fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev);
......@@ -343,5 +343,5 @@ module_exit(i82860_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com) "
"Ben Woodard <woodard@redhat.com>");
"Ben Woodard <woodard@redhat.com>");
MODULE_DESCRIPTION("ECC support for Intel 82860 memory hub controllers");
......@@ -174,7 +174,7 @@ struct i82875p_error_info {
static const struct i82875p_dev_info i82875p_devs[] = {
[I82875P] = {
.ctl_name = "i82875p"},
.ctl_name = "i82875p"},
};
static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code has
......@@ -186,7 +186,7 @@ static int i82875p_registered = 1;
static struct edac_pci_ctl_info *i82875p_pci;
static void i82875p_get_error_info(struct mem_ctl_info *mci,
struct i82875p_error_info *info)
struct i82875p_error_info *info)
{
struct pci_dev *pdev;
......@@ -222,8 +222,8 @@ static void i82875p_get_error_info(struct mem_ctl_info *mci,
}
static int i82875p_process_error_info(struct mem_ctl_info *mci,
struct i82875p_error_info *info,
int handle_errors)
struct i82875p_error_info *info,
int handle_errors)
{
int row, multi_chan;
......@@ -247,8 +247,8 @@ static int i82875p_process_error_info(struct mem_ctl_info *mci,
edac_mc_handle_ue(mci, info->eap, 0, row, "i82875p UE");
else
edac_mc_handle_ce(mci, info->eap, 0, info->derrsyn, row,
multi_chan ? (info->des & 0x1) : 0,
"i82875p CE");
multi_chan ? (info->des & 0x1) : 0,
"i82875p CE");
return 1;
}
......@@ -264,8 +264,8 @@ static void i82875p_check(struct mem_ctl_info *mci)
/* Return 0 on success or 1 on failure. */
static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
struct pci_dev **ovrfl_pdev,
void __iomem ** ovrfl_window)
struct pci_dev **ovrfl_pdev,
void __iomem **ovrfl_window)
{
struct pci_dev *dev;
void __iomem *window;
......@@ -293,7 +293,7 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
if (pci_enable_device(dev)) {
i82875p_printk(KERN_ERR, "%s(): Failed to enable overflow "
"device\n", __func__);
"device\n", __func__);
return 1;
}
......@@ -309,18 +309,18 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
if (window == NULL) {
i82875p_printk(KERN_ERR, "%s(): Failed to ioremap bar6\n",
__func__);
__func__);
goto fail1;
}
*ovrfl_window = window;
return 0;
fail1:
fail1:
pci_release_regions(dev);
#ifdef CORRECT_BIOS
fail0:
fail0:
pci_disable_device(dev);
#endif
/* NOTE: the ovrfl proc entry and pci_dev are intentionally left */
......@@ -393,7 +393,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
drc = readl(ovrfl_window + I82875P_DRC);
nr_chans = dual_channel_active(drc) + 1;
mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans),
nr_chans);
nr_chans);
if (!mci) {
rc = -ENOMEM;
......@@ -441,10 +441,10 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
debugf3("%s(): success\n", __func__);
return 0;
fail1:
fail1:
edac_mc_free(mci);
fail0:
fail0:
iounmap(ovrfl_window);
pci_release_regions(ovrfl_pdev);
......@@ -455,7 +455,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
/* returns count (>= 0), or negative on error */
static int __devinit i82875p_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
const struct pci_device_id *ent)
{
int rc;
......@@ -532,7 +532,7 @@ static int __init i82875p_init(void)
if (mci_pdev == NULL) {
mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82875_0, NULL);
PCI_DEVICE_ID_INTEL_82875_0, NULL);
if (!mci_pdev) {
debugf0("875p pci_get_device fail\n");
......@@ -551,10 +551,10 @@ static int __init i82875p_init(void)
return 0;
fail1:
fail1:
pci_unregister_driver(&i82875p_driver);
fail0:
fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev);
......
......@@ -136,7 +136,7 @@ static unsigned int disable_hardware_scrub = 0;
static struct edac_pci_ctl_info *r82600_pci;
static void r82600_get_error_info(struct mem_ctl_info *mci,
struct r82600_error_info *info)
struct r82600_error_info *info)
{
struct pci_dev *pdev;
......@@ -157,8 +157,8 @@ static void r82600_get_error_info(struct mem_ctl_info *mci,
}
static int r82600_process_error_info(struct mem_ctl_info *mci,
struct r82600_error_info *info,
int handle_errors)
struct r82600_error_info *info,
int handle_errors)
{
int error_found;
u32 eapaddr, page;
......@@ -180,8 +180,9 @@ static int r82600_process_error_info(struct mem_ctl_info *mci,
if (handle_errors)
edac_mc_handle_ce(mci, page, 0, /* not avail */
syndrome, edac_mc_find_csrow_by_page(mci, page), 0, /* channel */
mci->ctl_name);
syndrome,
edac_mc_find_csrow_by_page(mci, page),
0, mci->ctl_name);
}
if (info->eapr & BIT(1)) { /* UE? */
......@@ -190,8 +191,8 @@ static int r82600_process_error_info(struct mem_ctl_info *mci,
if (handle_errors)
/* 82600 doesn't give enough info */
edac_mc_handle_ue(mci, page, 0,
edac_mc_find_csrow_by_page(mci, page),
mci->ctl_name);
edac_mc_find_csrow_by_page(mci, page),
mci->ctl_name);
}
return error_found;
......@@ -212,7 +213,7 @@ static inline int ecc_enabled(u8 dramcr)
}
static void r82600_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
u8 dramcr)
u8 dramcr)
{
struct csrow_info *csrow;
int index;
......@@ -342,14 +343,14 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
debugf3("%s(): success\n", __func__);
return 0;
fail:
fail:
edac_mc_free(mci);
return -ENODEV;
}
/* returns count (>= 0), or negative on error */
static int __devinit r82600_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
const struct pci_device_id *ent)
{
debugf0("%s()\n", __func__);
......@@ -405,7 +406,7 @@ module_exit(r82600_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Tim Small <tim@buttersideup.com> - WPAD Ltd. "
"on behalf of EADS Astrium");
"on behalf of EADS Astrium");
MODULE_DESCRIPTION("MC support for Radisys 82600 memory controllers");
module_param(disable_hardware_scrub, bool, 0644);
......
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