summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/audio_module.c
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2021-02-21 21:12:59 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-10 09:25:33 +0100
commit1e37da45ce624bcd074443208b8a5b1c39dd4231 (patch)
tree4d5b58110f69b4ec3cb81ca08d49f178a61263d7 /drivers/staging/greybus/audio_module.c
parentf63a044747fef2bf14dc37b74bfed2735c70350d (diff)
staging/greybus: eliminate use of NAME_SIZE for strings
Instead, depend on the size of the destination buffer for easier refactoring. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20210221154258.119503-1-memxor@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus/audio_module.c')
-rw-r--r--drivers/staging/greybus/audio_module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c
index 0f9fdc077b4c..12c376c477b3 100644
--- a/drivers/staging/greybus/audio_module.c
+++ b/drivers/staging/greybus/audio_module.c
@@ -260,7 +260,7 @@ static int gb_audio_probe(struct gb_bundle *bundle,
INIT_LIST_HEAD(&gbmodule->widget_ctl_list);
INIT_LIST_HEAD(&gbmodule->jack_list);
gbmodule->dev = dev;
- snprintf(gbmodule->name, NAME_SIZE, "%s.%s", dev->driver->name,
+ snprintf(gbmodule->name, sizeof(gbmodule->name), "%s.%s", dev->driver->name,
dev_name(dev));
greybus_set_drvdata(bundle, gbmodule);
@@ -342,7 +342,7 @@ static int gb_audio_probe(struct gb_bundle *bundle,
/* inform above layer for uevent */
dev_dbg(dev, "Inform set_event:%d to above layer\n", 1);
/* prepare for the audio manager */
- strscpy(desc.name, gbmodule->name, GB_AUDIO_MANAGER_MODULE_NAME_LEN);
+ strscpy(desc.name, gbmodule->name, sizeof(desc.name));
desc.vid = 2; /* todo */
desc.pid = 3; /* todo */
desc.intf_id = gbmodule->dev_id;