From: Elise Lennion <elise.lennion@gmail.com>
To: vaibhav.sr@gmail.com, mgreer@animalcreek.com, johan@kernel.org,
elder@kernel.org, gregkh@linuxfoundation.org,
outreachy-kernel@googlegroups.com
Subject: [PATCH v2 2/2] staging: greybus: Replace sscanf with kstrto* to single variable conversion.
Date: Thu, 13 Oct 2016 19:45:59 -0300 [thread overview]
Message-ID: <20161013224559.GA13383@lennorien.com> (raw)
Fix checkpatch warning:
WARNING: Prefer kstrto<type> to single variable sscanf
kstrto* is designed to convert string to numerical value and makes
it easier to understand what the code does.
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
---
v2: No change since v1 in this file.
drivers/staging/greybus/audio_manager_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c
index 376e17c..e74fdcf 100644
--- a/drivers/staging/greybus/audio_manager_sysfs.c
+++ b/drivers/staging/greybus/audio_manager_sysfs.c
@@ -44,7 +44,7 @@ static ssize_t manager_sysfs_remove_store(
{
int id;
- int num = sscanf(buf, "%d", &id);
+ int num = kstrtoint(buf, 10, &id);
if (num != 1)
return -EINVAL;
@@ -65,7 +65,7 @@ static ssize_t manager_sysfs_dump_store(
{
int id;
- int num = sscanf(buf, "%d", &id);
+ int num = kstrtoint(buf, 10, &id);
if (num == 1) {
num = gb_audio_manager_dump_module(id);
--
2.7.4
next reply other threads:[~2016-10-13 22:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 22:45 Elise Lennion [this message]
2016-10-14 7:40 ` [PATCH v2 2/2] staging: greybus: Replace sscanf with kstrto* to single variable conversion Greg KH
2016-10-14 22:06 ` Elise Lennion
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=20161013224559.GA13383@lennorien.com \
--to=elise.lennion@gmail.com \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=mgreer@animalcreek.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=vaibhav.sr@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.