mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 13:15:57 +00:00
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: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
parent
4e7f09ad5e
commit
802cf2e1e0
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user