From 6aa2621183ee0142ebbcadff59417f0f1c10ae15 Mon Sep 17 00:00:00 2001 From: Murilo Opsfelder Araujo Date: Mon, 28 Jul 2014 20:45:06 -0300 Subject: [PATCH] Staging: android: timed_output.c: use kstrtoint() instead of sscanf() This patch makes checkpatch.pl happy by fixing the following warning: WARNING: Prefer kstrto to single variable sscanf Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/timed_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c index c341ac11c5a3..b41429f379fe 100644 --- a/drivers/staging/android/timed_output.c +++ b/drivers/staging/android/timed_output.c @@ -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); -- 2.20.1