Skip to content

Commit

Permalink
staging: greybus: audio_manager_sysfs: Replace sscanf with kstrto* to…
Browse files Browse the repository at this point in the history
… single variable conversion.

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>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Elise Lennion authored and Greg Kroah-Hartman committed Oct 24, 2016
1 parent 5bc45c9 commit f9a21a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/greybus/audio_manager_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit f9a21a3

Please sign in to comment.