edac: Don't add __func__ or __FILE__ for debugf[0-9] msgs
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 <mchehab@redhat.com>
This commit is contained in:
@@ -202,7 +202,7 @@ static void edac_device_ctrl_master_release(struct kobject *kobj)
|
||||
{
|
||||
struct edac_device_ctl_info *edac_dev = to_edacdev(kobj);
|
||||
|
||||
debugf4("%s() control index=%d\n", __func__, edac_dev->dev_idx);
|
||||
debugf4("control index=%d\n", edac_dev->dev_idx);
|
||||
|
||||
/* decrement the EDAC CORE module ref count */
|
||||
module_put(edac_dev->owner);
|
||||
@@ -233,12 +233,12 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
|
||||
struct bus_type *edac_subsys;
|
||||
int err;
|
||||
|
||||
debugf1("%s()\n", __func__);
|
||||
debugf1("\n");
|
||||
|
||||
/* get the /sys/devices/system/edac reference */
|
||||
edac_subsys = edac_get_sysfs_subsys();
|
||||
if (edac_subsys == NULL) {
|
||||
debugf1("%s() no edac_subsys error\n", __func__);
|
||||
debugf1("no edac_subsys error\n");
|
||||
err = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
@@ -264,8 +264,8 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
|
||||
&edac_subsys->dev_root->kobj,
|
||||
"%s", edac_dev->name);
|
||||
if (err) {
|
||||
debugf1("%s()Failed to register '.../edac/%s'\n",
|
||||
__func__, edac_dev->name);
|
||||
debugf1("Failed to register '.../edac/%s'\n",
|
||||
edac_dev->name);
|
||||
goto err_kobj_reg;
|
||||
}
|
||||
kobject_uevent(&edac_dev->kobj, KOBJ_ADD);
|
||||
@@ -274,8 +274,8 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
|
||||
* edac_device_unregister_sysfs_main_kobj() must be used
|
||||
*/
|
||||
|
||||
debugf4("%s() Registered '.../edac/%s' kobject\n",
|
||||
__func__, edac_dev->name);
|
||||
debugf4("Registered '.../edac/%s' kobject\n",
|
||||
edac_dev->name);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -296,9 +296,9 @@ err_out:
|
||||
*/
|
||||
void edac_device_unregister_sysfs_main_kobj(struct edac_device_ctl_info *dev)
|
||||
{
|
||||
debugf0("%s()\n", __func__);
|
||||
debugf4("%s() name of kobject is: %s\n",
|
||||
__func__, kobject_name(&dev->kobj));
|
||||
debugf0("\n");
|
||||
debugf4("name of kobject is: %s\n",
|
||||
kobject_name(&dev->kobj));
|
||||
|
||||
/*
|
||||
* Unregister the edac device's kobject and
|
||||
@@ -336,7 +336,7 @@ static void edac_device_ctrl_instance_release(struct kobject *kobj)
|
||||
{
|
||||
struct edac_device_instance *instance;
|
||||
|
||||
debugf1("%s()\n", __func__);
|
||||
debugf1("\n");
|
||||
|
||||
/* map from this kobj to the main control struct
|
||||
* and then dec the main kobj count
|
||||
@@ -442,7 +442,7 @@ static void edac_device_ctrl_block_release(struct kobject *kobj)
|
||||
{
|
||||
struct edac_device_block *block;
|
||||
|
||||
debugf1("%s()\n", __func__);
|
||||
debugf1("\n");
|
||||
|
||||
/* get the container of the kobj */
|
||||
block = to_block(kobj);
|
||||
@@ -524,10 +524,10 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
|
||||
struct edac_dev_sysfs_block_attribute *sysfs_attrib;
|
||||
struct kobject *main_kobj;
|
||||
|
||||
debugf4("%s() Instance '%s' inst_p=%p block '%s' block_p=%p\n",
|
||||
__func__, instance->name, instance, block->name, block);
|
||||
debugf4("%s() block kobj=%p block kobj->parent=%p\n",
|
||||
__func__, &block->kobj, &block->kobj.parent);
|
||||
debugf4("Instance '%s' inst_p=%p block '%s' block_p=%p\n",
|
||||
instance->name, instance, block->name, block);
|
||||
debugf4("block kobj=%p block kobj->parent=%p\n",
|
||||
&block->kobj, &block->kobj.parent);
|
||||
|
||||
/* init this block's kobject */
|
||||
memset(&block->kobj, 0, sizeof(struct kobject));
|
||||
@@ -546,8 +546,8 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
|
||||
&instance->kobj,
|
||||
"%s", block->name);
|
||||
if (err) {
|
||||
debugf1("%s() Failed to register instance '%s'\n",
|
||||
__func__, block->name);
|
||||
debugf1("Failed to register instance '%s'\n",
|
||||
block->name);
|
||||
kobject_put(main_kobj);
|
||||
err = -ENODEV;
|
||||
goto err_out;
|
||||
@@ -560,9 +560,8 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
|
||||
if (sysfs_attrib && block->nr_attribs) {
|
||||
for (i = 0; i < block->nr_attribs; i++, sysfs_attrib++) {
|
||||
|
||||
debugf4("%s() creating block attrib='%s' "
|
||||
debugf4("creating block attrib='%s' "
|
||||
"attrib->%p to kobj=%p\n",
|
||||
__func__,
|
||||
sysfs_attrib->attr.name,
|
||||
sysfs_attrib, &block->kobj);
|
||||
|
||||
@@ -647,14 +646,14 @@ static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
|
||||
err = kobject_init_and_add(&instance->kobj, &ktype_instance_ctrl,
|
||||
&edac_dev->kobj, "%s", instance->name);
|
||||
if (err != 0) {
|
||||
debugf2("%s() Failed to register instance '%s'\n",
|
||||
__func__, instance->name);
|
||||
debugf2("Failed to register instance '%s'\n",
|
||||
instance->name);
|
||||
kobject_put(main_kobj);
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
debugf4("%s() now register '%d' blocks for instance %d\n",
|
||||
__func__, instance->nr_blocks, idx);
|
||||
debugf4("now register '%d' blocks for instance %d\n",
|
||||
instance->nr_blocks, idx);
|
||||
|
||||
/* register all blocks of this instance */
|
||||
for (i = 0; i < instance->nr_blocks; i++) {
|
||||
@@ -670,8 +669,8 @@ static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
|
||||
}
|
||||
kobject_uevent(&instance->kobj, KOBJ_ADD);
|
||||
|
||||
debugf4("%s() Registered instance %d '%s' kobject\n",
|
||||
__func__, idx, instance->name);
|
||||
debugf4("Registered instance %d '%s' kobject\n",
|
||||
idx, instance->name);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -715,7 +714,7 @@ static int edac_device_create_instances(struct edac_device_ctl_info *edac_dev)
|
||||
int i, j;
|
||||
int err;
|
||||
|
||||
debugf0("%s()\n", __func__);
|
||||
debugf0("\n");
|
||||
|
||||
/* iterate over creation of the instances */
|
||||
for (i = 0; i < edac_dev->nr_instances; i++) {
|
||||
@@ -817,12 +816,12 @@ int edac_device_create_sysfs(struct edac_device_ctl_info *edac_dev)
|
||||
int err;
|
||||
struct kobject *edac_kobj = &edac_dev->kobj;
|
||||
|
||||
debugf0("%s() idx=%d\n", __func__, edac_dev->dev_idx);
|
||||
debugf0("idx=%d\n", edac_dev->dev_idx);
|
||||
|
||||
/* go create any main attributes callers wants */
|
||||
err = edac_device_add_main_sysfs_attributes(edac_dev);
|
||||
if (err) {
|
||||
debugf0("%s() failed to add sysfs attribs\n", __func__);
|
||||
debugf0("failed to add sysfs attribs\n");
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
@@ -832,8 +831,8 @@ int edac_device_create_sysfs(struct edac_device_ctl_info *edac_dev)
|
||||
err = sysfs_create_link(edac_kobj,
|
||||
&edac_dev->dev->kobj, EDAC_DEVICE_SYMLINK);
|
||||
if (err) {
|
||||
debugf0("%s() sysfs_create_link() returned err= %d\n",
|
||||
__func__, err);
|
||||
debugf0("sysfs_create_link() returned err= %d\n",
|
||||
err);
|
||||
goto err_remove_main_attribs;
|
||||
}
|
||||
|
||||
@@ -843,14 +842,14 @@ int edac_device_create_sysfs(struct edac_device_ctl_info *edac_dev)
|
||||
*/
|
||||
err = edac_device_create_instances(edac_dev);
|
||||
if (err) {
|
||||
debugf0("%s() edac_device_create_instances() "
|
||||
"returned err= %d\n", __func__, err);
|
||||
debugf0("edac_device_create_instances() "
|
||||
"returned err= %d\n", err);
|
||||
goto err_remove_link;
|
||||
}
|
||||
|
||||
|
||||
debugf4("%s() create-instances done, idx=%d\n",
|
||||
__func__, edac_dev->dev_idx);
|
||||
debugf4("create-instances done, idx=%d\n",
|
||||
edac_dev->dev_idx);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -873,7 +872,7 @@ err_out:
|
||||
*/
|
||||
void edac_device_remove_sysfs(struct edac_device_ctl_info *edac_dev)
|
||||
{
|
||||
debugf0("%s()\n", __func__);
|
||||
debugf0("\n");
|
||||
|
||||
/* remove any main attributes for this device */
|
||||
edac_device_remove_main_sysfs_attributes(edac_dev);
|
||||
|
Reference in New Issue
Block a user