mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
MIPS: arc: Replace deprecated strcpy() with memcpy()
strcpy() is deprecated; use memcpy() instead. Use pr_debug() instead of printk(KERN_DEBUG) to silence a checkpatch warning. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
committed by
Thomas Bogendoerfer
parent
19b32dbba0
commit
267ac0a800
@@ -42,12 +42,13 @@ static char __init *move_firmware_args(int argc, LONG *argv, char *cp)
|
|||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
int actr, i;
|
int actr, i;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
actr = 1; /* Always ignore argv[0] */
|
actr = 1; /* Always ignore argv[0] */
|
||||||
|
|
||||||
while (actr < argc) {
|
while (actr < argc) {
|
||||||
for (i = 0; i < ARRAY_SIZE(used_arc); i++) {
|
for (i = 0; i < ARRAY_SIZE(used_arc); i++) {
|
||||||
int len = strlen(used_arc[i][0]);
|
len = strlen(used_arc[i][0]);
|
||||||
|
|
||||||
if (!strncmp(prom_argv(actr), used_arc[i][0], len)) {
|
if (!strncmp(prom_argv(actr), used_arc[i][0], len)) {
|
||||||
/* Ok, we want it. First append the replacement... */
|
/* Ok, we want it. First append the replacement... */
|
||||||
@@ -57,8 +58,9 @@ static char __init *move_firmware_args(int argc, LONG *argv, char *cp)
|
|||||||
s = strchr(prom_argv(actr), '=');
|
s = strchr(prom_argv(actr), '=');
|
||||||
if (s) {
|
if (s) {
|
||||||
s++;
|
s++;
|
||||||
strcpy(cp, s);
|
len = strlen(s);
|
||||||
cp += strlen(s);
|
memcpy(cp, s, len + 1);
|
||||||
|
cp += len;
|
||||||
}
|
}
|
||||||
*cp++ = ' ';
|
*cp++ = ' ';
|
||||||
break;
|
break;
|
||||||
@@ -74,6 +76,7 @@ void __init prom_init_cmdline(int argc, LONG *argv)
|
|||||||
{
|
{
|
||||||
char *cp;
|
char *cp;
|
||||||
int actr, i;
|
int actr, i;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
actr = 1; /* Always ignore argv[0] */
|
actr = 1; /* Always ignore argv[0] */
|
||||||
|
|
||||||
@@ -86,14 +89,15 @@ void __init prom_init_cmdline(int argc, LONG *argv)
|
|||||||
|
|
||||||
while (actr < argc) {
|
while (actr < argc) {
|
||||||
for (i = 0; i < ARRAY_SIZE(ignored); i++) {
|
for (i = 0; i < ARRAY_SIZE(ignored); i++) {
|
||||||
int len = strlen(ignored[i]);
|
len = strlen(ignored[i]);
|
||||||
|
|
||||||
if (!strncmp(prom_argv(actr), ignored[i], len))
|
if (!strncmp(prom_argv(actr), ignored[i], len))
|
||||||
goto pic_cont;
|
goto pic_cont;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, we want it. */
|
/* Ok, we want it. */
|
||||||
strcpy(cp, prom_argv(actr));
|
len = strlen(prom_argv(actr));
|
||||||
cp += strlen(prom_argv(actr));
|
memcpy(cp, prom_argv(actr), len + 1);
|
||||||
|
cp += len;
|
||||||
*cp++ = ' ';
|
*cp++ = ' ';
|
||||||
|
|
||||||
pic_cont:
|
pic_cont:
|
||||||
@@ -105,6 +109,6 @@ void __init prom_init_cmdline(int argc, LONG *argv)
|
|||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
|
|
||||||
#ifdef DEBUG_CMDLINE
|
#ifdef DEBUG_CMDLINE
|
||||||
printk(KERN_DEBUG "prom cmdline: %s\n", arcs_cmdline);
|
pr_debug("prom cmdline: %s\n", arcs_cmdline);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user