Skip to content

Commit 674fb05

Browse files
tobluxandreas-gaisler
authored andcommitted
sparc: vio: Replace snprintf with strscpy in vio_create_one
Replace snprintf("%s", ...) with the faster and more direct strscpy(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
1 parent 2153b2e commit 674fb05

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/sparc/kernel/vio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <linux/kernel.h>
1414
#include <linux/slab.h>
15+
#include <linux/string.h>
1516
#include <linux/irq.h>
1617
#include <linux/export.h>
1718
#include <linux/init.h>
@@ -378,8 +379,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
378379
* the parent doesn't require the MD node info.
379380
*/
380381
if (node_name != NULL) {
381-
(void) snprintf(vdev->node_name, VIO_MAX_NAME_LEN, "%s",
382-
node_name);
382+
strscpy(vdev->node_name, node_name);
383383

384384
err = mdesc_get_node_info(hp, mp, node_name,
385385
&vdev->md_node_info);

0 commit comments

Comments
 (0)