All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] staging: greybus: audio_manager_sysfs: Replace sscanf with kstrto* to single variable conversion.
@ 2016-10-14 21:54 Elise Lennion
  0 siblings, 0 replies; only message in thread
From: Elise Lennion @ 2016-10-14 21:54 UTC (permalink / raw)
  To: vaibhav.sr, mgreer, johan, elder, gregkh, outreachy-kernel

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>
---
 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-14 21:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14 21:54 [PATCH v3] staging: greybus: audio_manager_sysfs: Replace sscanf with kstrto* to single variable conversion Elise Lennion

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.