From: Philipp Zabel
Date: Tue, 24 Mar 2015 17:30:50 +0000 (-0300)
Subject: [media] coda: use strlcpy instead of snprintf
X-Git-Tag: firefly_0821_release~176^2~795^2~1015
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bf249daf079492d60306ad1c5c78d53255ff15a3;p=firefly-linux-kernel-4.4.55.git
[media] coda: use strlcpy instead of snprintf
There is no need to take the detour through a "%s" format string
to create a copy of a string.
Signed-off-by: Philipp Zabel
Signed-off-by: Kamil Debski
Signed-off-by: Mauro Carvalho Chehab
---
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 2906dd225143..443886535230 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1915,8 +1915,7 @@ static int coda_register_device(struct coda_dev *dev, int i)
if (i >= dev->devtype->num_vdevs)
return -EINVAL;
- snprintf(vfd->name, sizeof(vfd->name), "%s",
- dev->devtype->vdevs[i]->name);
+ strlcpy(vfd->name, dev->devtype->vdevs[i]->name, sizeof(vfd->name));
vfd->fops = &coda_fops;
vfd->ioctl_ops = &coda_ioctl_ops;
vfd->release = video_device_release_empty,