Skip to content

Commit

Permalink
edac: Don't add __func__ or __FILE__ for debugf[0-9] msgs
Browse files Browse the repository at this point in the history
The debug macro already adds that. Most of the work here was
made by this small script:

$f .=$_ while (<>);

$f =~ s/(debugf[0-9]\s*\(\s*)__FILE__\s*": /\1"/g;
$f =~ s/(debugf[0-9]\s*\(\s*)__FILE__\s*/\1/g;
$f =~ s/(debugf[0-9]\s*\(\s*)__FILE__\s*"MC: /\1"/g;

$f =~ s/(debugf[0-9]\s*\(\")\%s[\:\,\(\)]*\s*([^\"]*\s*[^\)]+)__func__\s*\,\s*/\1\2/g;
$f =~ s/(debugf[0-9]\s*\(\")\%s[\:\,\(\)]*\s*([^\"]*\s*[^\)]+),\s*__func__\s*\)/\1\2)/g;
$f =~ s/(debugf[0-9]\s*\(\"MC\:\s*)\%s[\:\,\(\)]*\s*([^\"]*\s*[^\)]+)__func__\s*\,\s*/\1\2/g;
$f =~ s/(debugf[0-9]\s*\(\"MC\:\s*)\%s[\:\,\(\)]*\s*([^\"]*\s*[^\)]+),\s*__func__\s*\)/\1\2)/g;

$f =~ s/\"MC\: \\n\"/"MC:\\n"/g;

print $f;

After running the script, manual cleanups were done to fix it the remaining
places.

While here, removed the __LINE__ on most places, as it doesn't actually give
useful info on most places.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Mauro Carvalho Chehab committed Jun 11, 2012
1 parent 2639c3e commit dd23cd6
Show file tree
Hide file tree
Showing 26 changed files with 331 additions and 357 deletions.
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("%s()\n", __func__);
debugf3("\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("%s()\n", __func__);
debugf0("\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("%s(): mci = %p\n", __func__, mci);
debugf0("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("%s(): failed edac_mc_add_mc()\n", __func__);
debugf3("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("%s(): success\n", __func__);
debugf3("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("%s()\n", __func__);
debugf0("\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("%s()\n", __func__);
debugf0("\n");

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

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

static void cpc925_init_csrows(struct mem_ctl_info *mci)
Expand Down Expand Up @@ -512,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("%s: ECC physical address 0x%lx\n", __func__, pa);
debugf0("ECC physical address 0x%lx\n", pa);
}

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

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

continue;

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

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

Expand All @@ -900,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("%s, Mem Scrub Ctrl Register 0x%x\n", __func__, mscr);
debugf0("Mem Scrub Ctrl Register 0x%x\n", mscr);

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

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

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

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

if (!devres_open_group(&pdev->dev, cpc925_probe, GFP_KERNEL)) {
res = -ENOMEM;
Expand Down Expand Up @@ -1026,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("%s: success\n", __func__);
debugf0("success\n");

res = 0;
goto out;
Expand Down
34 changes: 17 additions & 17 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("%s()\n", __func__);
debugf3("\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("%s()\n", __func__);
debugf3("\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("%s()\n", __func__);
debugf3("\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("%s()\n", __func__);
debugf3("\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("%s()\n", __func__);
debugf3("\n");
e752x_get_error_info(mci, &info);
e752x_process_error_info(mci, &info, 1);
}
Expand Down Expand Up @@ -1102,7 +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("%s(): (%d) cumul_size 0x%x\n", __func__, index,
debugf3("(%d) cumul_size 0x%x\n", index,
cumul_size);
if (cumul_size == last_cumul_size)
continue; /* not populated */
Expand Down Expand Up @@ -1270,7 +1270,7 @@ 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("%s(): mci\n", __func__);
debugf0("mci\n");
debugf0("Starting Probe1\n");

/* check to see if device 0 function 1 is enabled; if it isn't, we
Expand Down Expand Up @@ -1301,7 +1301,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
if (mci == NULL)
return -ENOMEM;

debugf3("%s(): init mci\n", __func__);
debugf3("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 +1311,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
mci->mod_ver = E752X_REVISION;
mci->pdev = &pdev->dev;

debugf3("%s(): init pvt\n", __func__);
debugf3("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 +1321,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
return -ENODEV;
}

debugf3("%s(): more mci init\n", __func__);
debugf3("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 +1343,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("%s(): tolm, remapbase, remaplimit\n", __func__);
debugf3("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 +1360,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("%s(): failed edac_mc_add_mc()\n", __func__);
debugf3("failed edac_mc_add_mc()\n");
goto fail;
}

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

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

fail:
Expand All @@ -1394,7 +1394,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("%s()\n", __func__);
debugf0("\n");

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

debugf0("%s()\n", __func__);
debugf0("\n");

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

debugf3("%s()\n", __func__);
debugf3("\n");

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

static void __exit e752x_exit(void)
{
debugf3("%s()\n", __func__);
debugf3("\n");
pci_unregister_driver(&e752x_driver);
}

Expand Down
Loading

0 comments on commit dd23cd6

Please sign in to comment.