From: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
To: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org,
Murilo Opsfelder Araujo <mopsfelder@gmail.com>
Subject: [PATCH] Staging: android: timed_output.c: use kstrtoint() instead of sscanf()
Date: Mon, 28 Jul 2014 20:45:06 -0300 [thread overview]
Message-ID: <1406591106-2234-1-git-send-email-mopsfelder@gmail.com> (raw)
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>
---
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 c341ac1..b41429f 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);
--
1.7.10.4
reply other threads:[~2014-07-28 23:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406591106-2234-1-git-send-email-mopsfelder@gmail.com \
--to=mopsfelder@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome