ACPI: sysfs: Cleanup message printing
authorHanjun Guo <guohanjun@huawei.com>
Wed, 2 Jun 2021 08:54:35 +0000 (16:54 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Jun 2021 13:36:46 +0000 (15:36 +0200)
We have pr_fmt() in sysfs.c but we still use pr_err(PREFIX ...) which
is wrong, remove the duplicated PREFIX and also using pr_* to replace
printk to simlify the code.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/sysfs.c

index d259271..88629d2 100644 (file)
@@ -359,8 +359,7 @@ static int acpi_table_attr_init(struct kobject *tables_obj,
        }
        table_attr->instance++;
        if (table_attr->instance > ACPI_MAX_TABLE_INSTANCES) {
-               pr_warn("%4.4s: too many table instances\n",
-                       table_attr->name);
+               pr_warn("%4.4s: too many table instances\n", table_attr->name);
                return -ERANGE;
        }
 
@@ -737,8 +736,7 @@ static ssize_t counter_set(struct kobject *kobj,
                goto end;
 
        if (!(status & ACPI_EVENT_FLAG_HAS_HANDLER)) {
-               printk(KERN_WARNING PREFIX
-                      "Can not change Invalid GPE/Fixed Event status\n");
+               pr_warn("Can not change Invalid GPE/Fixed Event status\n");
                return -EINVAL;
        }
 
@@ -983,7 +981,7 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
        return;
 
  err_out:
-       pr_err(PREFIX "Unable to add hotplug profile '%s'\n", name);
+       pr_err("Unable to add hotplug profile '%s'\n", name);
 }
 
 static ssize_t force_remove_show(struct kobject *kobj,