Commit 802cf2e1 authored by Darren Hart's avatar Darren Hart

samsung-laptop.c: Prefer kstrtoint over single variable sscanf

Replace existing usage of single variable sscanf with kstrtoint for
consistency with checkpatch warnings against such usage.
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 4e7f09ad
......@@ -768,7 +768,7 @@ static ssize_t set_battery_life_extender(struct device *dev,
struct samsung_laptop *samsung = dev_get_drvdata(dev);
int ret, value;
if (!count || sscanf(buf, "%i", &value) != 1)
if (!count || kstrtoint(buf, 0, &value) != 0)
return -EINVAL;
ret = write_battery_life_extender(samsung, !!value);
......@@ -837,7 +837,7 @@ static ssize_t set_usb_charge(struct device *dev,
struct samsung_laptop *samsung = dev_get_drvdata(dev);
int ret, value;
if (!count || sscanf(buf, "%i", &value) != 1)
if (!count || kstrtoint(buf, 0, &value) != 0)
return -EINVAL;
ret = write_usb_charge(samsung, !!value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment