[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <51614951.80606@asianux.com>
Date: Sun, 07 Apr 2013 18:24:17 +0800
From: Chen Gang <gang.chen@...anux.com>
To: jason.wessel@...driver.com
CC: kgdb-bugreport@...ts.sourceforge.net,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] kernel: debug: memcpy overlaped, use memmove instead of memcpy.
in memcpy, src and dest are overlaped.
for default implementaion or some architectures, it is OK.
but we can not be sure that it is OK for all platforms.
and in this condition, the performance are not quite important.
so better to use standard ways: let memmove instead of memcpy.
Signed-off-by: Chen Gang <gang.chen@...anux.com>
---
kernel/debug/kdb/kdb_support.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/debug/kdb/kdb_support.c b/kernel/debug/kdb/kdb_support.c
index d35cc2d..990b3cc 100644
--- a/kernel/debug/kdb/kdb_support.c
+++ b/kernel/debug/kdb/kdb_support.c
@@ -129,13 +129,13 @@ int kdbnearsym(unsigned long addr, kdb_symtab_t *symtab)
}
if (i >= ARRAY_SIZE(kdb_name_table)) {
debug_kfree(kdb_name_table[0]);
- memcpy(kdb_name_table, kdb_name_table+1,
+ memmove(kdb_name_table, kdb_name_table+1,
sizeof(kdb_name_table[0]) *
(ARRAY_SIZE(kdb_name_table)-1));
} else {
debug_kfree(knt1);
knt1 = kdb_name_table[i];
- memcpy(kdb_name_table+i, kdb_name_table+i+1,
+ memmove(kdb_name_table+i, kdb_name_table+i+1,
sizeof(kdb_name_table[0]) *
(ARRAY_SIZE(kdb_name_table)-i-1));
}
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists