提交 73d4511a 编写于 作者: J Josh 提交者: Rafael J. Wysocki

ACPI: strict_strtoul() and printk() cleanup in acpi_pad

Replace a few calls to strict_strtoul() in acpi_pad.c with kstrtoul()
and use pr_warn() instead of printk() in the same file.

[rjw: Modified the subject and changelog.]
Signed-off-by: NJosh Taylor <joshua.taylor0@gmail.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 8ab0ab25
...@@ -286,7 +286,7 @@ static ssize_t acpi_pad_rrtime_store(struct device *dev, ...@@ -286,7 +286,7 @@ static ssize_t acpi_pad_rrtime_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
unsigned long num; unsigned long num;
if (strict_strtoul(buf, 0, &num)) if (kstrtoul(buf, 0, &num))
return -EINVAL; return -EINVAL;
if (num < 1 || num >= 100) if (num < 1 || num >= 100)
return -EINVAL; return -EINVAL;
...@@ -309,7 +309,7 @@ static ssize_t acpi_pad_idlepct_store(struct device *dev, ...@@ -309,7 +309,7 @@ static ssize_t acpi_pad_idlepct_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
unsigned long num; unsigned long num;
if (strict_strtoul(buf, 0, &num)) if (kstrtoul(buf, 0, &num))
return -EINVAL; return -EINVAL;
if (num < 1 || num >= 100) if (num < 1 || num >= 100)
return -EINVAL; return -EINVAL;
...@@ -332,7 +332,7 @@ static ssize_t acpi_pad_idlecpus_store(struct device *dev, ...@@ -332,7 +332,7 @@ static ssize_t acpi_pad_idlecpus_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
unsigned long num; unsigned long num;
if (strict_strtoul(buf, 0, &num)) if (kstrtoul(buf, 0, &num))
return -EINVAL; return -EINVAL;
mutex_lock(&isolated_cpus_lock); mutex_lock(&isolated_cpus_lock);
acpi_pad_idle_cpus(num); acpi_pad_idle_cpus(num);
...@@ -457,7 +457,7 @@ static void acpi_pad_notify(acpi_handle handle, u32 event, ...@@ -457,7 +457,7 @@ static void acpi_pad_notify(acpi_handle handle, u32 event,
dev_name(&device->dev), event, 0); dev_name(&device->dev), event, 0);
break; break;
default: default:
printk(KERN_WARNING "Unsupported event [0x%x]\n", event); pr_warn("Unsupported event [0x%x]\n", event);
break; break;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册