Skip to content

Commit

Permalink
edac: Convert debugfX to edac_dbg(X,
Browse files Browse the repository at this point in the history
Use a more common debugging style.

Remove __FILE__ uses, add missing newlines,
coalesce formats and align arguments.

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
JoePerches authored and Mauro Carvalho Chehab committed Jun 11, 2012
1 parent 7e88185 commit 956b9ba
Show file tree
Hide file tree
Showing 30 changed files with 921 additions and 962 deletions.
270 changes: 132 additions & 138 deletions drivers/edac/amd64_edac.c

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions drivers/edac/amd64_edac_inj.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ static ssize_t amd64_inject_read_store(struct device *dev,
/* Issue 'word' and 'bit' along with the READ request */
amd64_write_pci_cfg(pvt->F3, F10_NB_ARRAY_DATA, word_bits);

debugf0("section=0x%x word_bits=0x%x\n", section, word_bits);
edac_dbg(0, "section=0x%x word_bits=0x%x\n",
section, word_bits);

return count;
}
Expand Down Expand Up @@ -177,7 +178,8 @@ static ssize_t amd64_inject_write_store(struct device *dev,
/* Issue 'word' and 'bit' along with the READ request */
amd64_write_pci_cfg(pvt->F3, F10_NB_ARRAY_DATA, word_bits);

debugf0("section=0x%x word_bits=0x%x\n", section, word_bits);
edac_dbg(0, "section=0x%x word_bits=0x%x\n",
section, word_bits);

return count;
}
Expand Down
14 changes: 7 additions & 7 deletions drivers/edac/amd76x_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static int amd76x_process_error_info(struct mem_ctl_info *mci,
static void amd76x_check(struct mem_ctl_info *mci)
{
struct amd76x_error_info info;
debugf3("\n");
edac_dbg(3, "\n");
amd76x_get_error_info(mci, &info);
amd76x_process_error_info(mci, &info, 1);
}
Expand Down Expand Up @@ -241,7 +241,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
u32 ems_mode;
struct amd76x_error_info discard;

debugf0("\n");
edac_dbg(0, "\n");
pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &ems);
ems_mode = (ems >> 10) & 0x3;

Expand All @@ -256,7 +256,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
if (mci == NULL)
return -ENOMEM;

debugf0("mci = %p\n", mci);
edac_dbg(0, "mci = %p\n", mci);
mci->pdev = &pdev->dev;
mci->mtype_cap = MEM_FLAG_RDDR;
mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
Expand All @@ -276,7 +276,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
* type of memory controller. The ID is therefore hardcoded to 0.
*/
if (edac_mc_add_mc(mci)) {
debugf3("failed edac_mc_add_mc()\n");
edac_dbg(3, "failed edac_mc_add_mc()\n");
goto fail;
}

Expand All @@ -292,7 +292,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
}

/* get this far and it's successful */
debugf3("success\n");
edac_dbg(3, "success\n");
return 0;

fail:
Expand All @@ -304,7 +304,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
static int __devinit amd76x_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
debugf0("\n");
edac_dbg(0, "\n");

/* don't need to call pci_enable_device() */
return amd76x_probe1(pdev, ent->driver_data);
Expand All @@ -322,7 +322,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
{
struct mem_ctl_info *mci;

debugf0("\n");
edac_dbg(0, "\n");

if (amd76x_pci)
edac_pci_release_generic_ctl(amd76x_pci);
Expand Down
22 changes: 11 additions & 11 deletions drivers/edac/cpc925_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ static void get_total_mem(struct cpc925_mc_pdata *pdata)
reg += aw;
size = of_read_number(reg, sw);
reg += sw;
debugf1("start 0x%lx, size 0x%lx\n", start, size);
edac_dbg(1, "start 0x%lx, size 0x%lx\n", start, size);
pdata->total_mem += size;
} while (reg < reg_end);

of_node_put(np);
debugf0("total_mem 0x%lx\n", pdata->total_mem);
edac_dbg(0, "total_mem 0x%lx\n", pdata->total_mem);
}

static void cpc925_init_csrows(struct mem_ctl_info *mci)
Expand Down Expand Up @@ -511,7 +511,7 @@ static void cpc925_mc_get_pfn(struct mem_ctl_info *mci, u32 mear,
*offset = pa & (PAGE_SIZE - 1);
*pfn = pa >> PAGE_SHIFT;

debugf0("ECC physical address 0x%lx\n", pa);
edac_dbg(0, "ECC physical address 0x%lx\n", pa);
}

static int cpc925_mc_find_channel(struct mem_ctl_info *mci, u16 syndrome)
Expand Down Expand Up @@ -851,8 +851,8 @@ static void cpc925_add_edac_devices(void __iomem *vbase)
goto err2;
}

debugf0("Successfully added edac device for %s\n",
dev_info->ctl_name);
edac_dbg(0, "Successfully added edac device for %s\n",
dev_info->ctl_name);

continue;

Expand Down Expand Up @@ -883,8 +883,8 @@ static void cpc925_del_edac_devices(void)
if (dev_info->exit)
dev_info->exit(dev_info);

debugf0("Successfully deleted edac device for %s\n",
dev_info->ctl_name);
edac_dbg(0, "Successfully deleted edac device for %s\n",
dev_info->ctl_name);
}
}

Expand All @@ -899,7 +899,7 @@ static int cpc925_get_sdram_scrub_rate(struct mem_ctl_info *mci)
mscr = __raw_readl(pdata->vbase + REG_MSCR_OFFSET);
si = (mscr & MSCR_SI_MASK) >> MSCR_SI_SHIFT;

debugf0("Mem Scrub Ctrl Register 0x%x\n", mscr);
edac_dbg(0, "Mem Scrub Ctrl Register 0x%x\n", mscr);

if (((mscr & MSCR_SCRUB_MOD_MASK) != MSCR_BACKGR_SCRUB) ||
(si == 0)) {
Expand Down Expand Up @@ -927,7 +927,7 @@ static int cpc925_mc_get_channels(void __iomem *vbase)
((mbcr & MBCR_64BITBUS_MASK) == 0))
dual = 1;

debugf0("%s channel\n", (dual > 0) ? "Dual" : "Single");
edac_dbg(0, "%s channel\n", (dual > 0) ? "Dual" : "Single");

return dual;
}
Expand All @@ -942,7 +942,7 @@ static int __devinit cpc925_probe(struct platform_device *pdev)
struct resource *r;
int res = 0, nr_channels;

debugf0("%s platform device found!\n", pdev->name);
edac_dbg(0, "%s platform device found!\n", pdev->name);

if (!devres_open_group(&pdev->dev, cpc925_probe, GFP_KERNEL)) {
res = -ENOMEM;
Expand Down Expand Up @@ -1024,7 +1024,7 @@ static int __devinit cpc925_probe(struct platform_device *pdev)
cpc925_add_edac_devices(vbase);

/* get this far and it's successful */
debugf0("success\n");
edac_dbg(0, "success\n");

res = 0;
goto out;
Expand Down
39 changes: 19 additions & 20 deletions drivers/edac/e752x_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
u32 remap;
struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info;

debugf3("\n");
edac_dbg(3, "\n");

if (page < pvt->tolm)
return page;
Expand All @@ -335,7 +335,7 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
int i;
struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info;

debugf3("\n");
edac_dbg(3, "\n");

/* convert the addr to 4k page */
page = sec1_add >> (PAGE_SHIFT - 4);
Expand Down Expand Up @@ -394,7 +394,7 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one,
int row;
struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info;

debugf3("\n");
edac_dbg(3, "\n");

if (error_one & 0x0202) {
error_2b = ded_add;
Expand Down Expand Up @@ -453,7 +453,7 @@ static inline void process_ue_no_info_wr(struct mem_ctl_info *mci,
if (!handle_error)
return;

debugf3("\n");
edac_dbg(3, "\n");
edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 0, 0, 0,
-1, -1, -1,
"e752x UE log memory write", "", NULL);
Expand Down Expand Up @@ -982,7 +982,7 @@ static void e752x_check(struct mem_ctl_info *mci)
{
struct e752x_error_info info;

debugf3("\n");
edac_dbg(3, "\n");
e752x_get_error_info(mci, &info);
e752x_process_error_info(mci, &info, 1);
}
Expand Down Expand Up @@ -1102,8 +1102,7 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
pci_read_config_byte(pdev, E752X_DRB + index, &value);
/* convert a 128 or 64 MiB DRB to a page size. */
cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
debugf3("(%d) cumul_size 0x%x\n", index,
cumul_size);
edac_dbg(3, "(%d) cumul_size 0x%x\n", index, cumul_size);
if (cumul_size == last_cumul_size)
continue; /* not populated */

Expand All @@ -1129,7 +1128,7 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
for (i = 0; i < csrow->nr_channels; i++) {
struct dimm_info *dimm = csrow->channels[i]->dimm;

debugf3("Initializing rank at (%i,%i)\n", index, i);
edac_dbg(3, "Initializing rank at (%i,%i)\n", index, i);
dimm->nr_pages = nr_pages / csrow->nr_channels;
dimm->grain = 1 << 12; /* 4KiB - resolution of CELOG */
dimm->mtype = MEM_RDDR; /* only one type supported */
Expand Down Expand Up @@ -1270,8 +1269,8 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
int drc_chan; /* Number of channels 0=1chan,1=2chan */
struct e752x_error_info discard;

debugf0("mci\n");
debugf0("Starting Probe1\n");
edac_dbg(0, "mci\n");
edac_dbg(0, "Starting Probe1\n");

/* check to see if device 0 function 1 is enabled; if it isn't, we
* assume the BIOS has reserved it for a reason and is expecting
Expand Down Expand Up @@ -1301,7 +1300,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
if (mci == NULL)
return -ENOMEM;

debugf3("init mci\n");
edac_dbg(3, "init mci\n");
mci->mtype_cap = MEM_FLAG_RDDR;
/* 3100 IMCH supports SECDEC only */
mci->edac_ctl_cap = (dev_idx == I3100) ? EDAC_FLAG_SECDED :
Expand All @@ -1311,7 +1310,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
mci->mod_ver = E752X_REVISION;
mci->pdev = &pdev->dev;

debugf3("init pvt\n");
edac_dbg(3, "init pvt\n");
pvt = (struct e752x_pvt *)mci->pvt_info;
pvt->dev_info = &e752x_devs[dev_idx];
pvt->mc_symmetric = ((ddrcsr & 0x10) != 0);
Expand All @@ -1321,7 +1320,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
return -ENODEV;
}

debugf3("more mci init\n");
edac_dbg(3, "more mci init\n");
mci->ctl_name = pvt->dev_info->ctl_name;
mci->dev_name = pci_name(pdev);
mci->edac_check = e752x_check;
Expand All @@ -1343,7 +1342,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
mci->edac_cap = EDAC_FLAG_SECDED; /* the only mode supported */
else
mci->edac_cap |= EDAC_FLAG_NONE;
debugf3("tolm, remapbase, remaplimit\n");
edac_dbg(3, "tolm, remapbase, remaplimit\n");

/* load the top of low memory, remap base, and remap limit vars */
pci_read_config_word(pdev, E752X_TOLM, &pci_data);
Expand All @@ -1360,7 +1359,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
* type of memory controller. The ID is therefore hardcoded to 0.
*/
if (edac_mc_add_mc(mci)) {
debugf3("failed edac_mc_add_mc()\n");
edac_dbg(3, "failed edac_mc_add_mc()\n");
goto fail;
}

Expand All @@ -1378,7 +1377,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
}

/* get this far and it's successful */
debugf3("success\n");
edac_dbg(3, "success\n");
return 0;

fail:
Expand All @@ -1394,7 +1393,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
static int __devinit e752x_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
debugf0("\n");
edac_dbg(0, "\n");

/* wake up and enable device */
if (pci_enable_device(pdev) < 0)
Expand All @@ -1408,7 +1407,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev)
struct mem_ctl_info *mci;
struct e752x_pvt *pvt;

debugf0("\n");
edac_dbg(0, "\n");

if (e752x_pci)
edac_pci_release_generic_ctl(e752x_pci);
Expand Down Expand Up @@ -1454,7 +1453,7 @@ static int __init e752x_init(void)
{
int pci_rc;

debugf3("\n");
edac_dbg(3, "\n");

/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();
Expand All @@ -1465,7 +1464,7 @@ static int __init e752x_init(void)

static void __exit e752x_exit(void)
{
debugf3("\n");
edac_dbg(3, "\n");
pci_unregister_driver(&e752x_driver);
}

Expand Down
Loading

0 comments on commit 956b9ba

Please sign in to comment.