mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 08:09:56 +00:00
Staging: android: timed_output.c: use kstrtoint() instead of sscanf()
This patch makes checkpatch.pl happy by fixing the following warning: WARNING: Prefer kstrto<type> to single variable sscanf Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7ebd4cba67
commit
6aa2621183
@ -41,8 +41,10 @@ static ssize_t enable_store(struct device *dev, struct device_attribute *attr,
|
||||
{
|
||||
struct timed_output_dev *tdev = dev_get_drvdata(dev);
|
||||
int value;
|
||||
int rc;
|
||||
|
||||
if (sscanf(buf, "%d", &value) != 1)
|
||||
rc = kstrtoint(buf, 0, &value);
|
||||
if (rc != 0)
|
||||
return -EINVAL;
|
||||
|
||||
tdev->enable(tdev, value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user