Skip to content

Commit 59d94ea

Browse files
tobluxandreas-gaisler
authored andcommitted
sparc: PCI: Replace deprecated strcpy() with strscpy()
strcpy() is deprecated; use strscpy() instead. No functional changes intended. Link: KSPP#88 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 3b1307e commit 59d94ea

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

arch/sparc/kernel/pcic.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/init.h>
1717
#include <linux/mm.h>
1818
#include <linux/slab.h>
19+
#include <linux/string.h>
1920
#include <linux/jiffies.h>
2021

2122
#include <asm/swift.h> /* for cache flushing. */
@@ -352,7 +353,7 @@ int __init pcic_probe(void)
352353
pbm = &pcic->pbm;
353354
pbm->prom_node = node;
354355
prom_getstring(node, "name", namebuf, 63); namebuf[63] = 0;
355-
strcpy(pbm->prom_name, namebuf);
356+
strscpy(pbm->prom_name, namebuf);
356357

357358
{
358359
extern int pcic_nmi_trap_patch[4];
@@ -477,7 +478,7 @@ static void pcic_map_pci_device(struct linux_pcic *pcic,
477478
int j;
478479

479480
if (node == 0 || node == -1) {
480-
strcpy(namebuf, "???");
481+
strscpy(namebuf, "???");
481482
} else {
482483
prom_getstring(node, "name", namebuf, 63); namebuf[63] = 0;
483484
}
@@ -536,7 +537,7 @@ pcic_fill_irq(struct linux_pcic *pcic, struct pci_dev *dev, int node)
536537
char namebuf[64];
537538

538539
if (node == 0 || node == -1) {
539-
strcpy(namebuf, "???");
540+
strscpy(namebuf, "???");
540541
} else {
541542
prom_getstring(node, "name", namebuf, sizeof(namebuf));
542543
}

0 commit comments

Comments
 (0)