OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e7f09a
)
samsung-laptop.c: Prefer kstrtoint over single variable sscanf
author
Darren Hart
<dvhart@linux.intel.com>
Sat, 7 Feb 2015 02:49:23 +0000
(18:49 -0800)
committer
Darren Hart
<dvhart@linux.intel.com>
Sat, 7 Feb 2015 02:53:59 +0000
(18:53 -0800)
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>
drivers/platform/x86/samsung-laptop.c
patch
|
blob
|
history
diff --git
a/drivers/platform/x86/samsung-laptop.c
b/drivers/platform/x86/samsung-laptop.c
index
3257b02
..
9e701b2
100644
(file)
--- a/
drivers/platform/x86/samsung-laptop.c
+++ b/
drivers/platform/x86/samsung-laptop.c
@@
-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);