Browse Source

[MTD] mtdoops cleanup

Use memcpy instead of open coding a copy loop.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Peter Korsgaard 17 years ago
parent
commit
235d6200ea
1 changed files with 2 additions and 5 deletions
  1. 2 5
      drivers/mtd/mtdoops.c

+ 2 - 5
drivers/mtd/mtdoops.c

@@ -286,7 +286,6 @@ mtdoops_console_write(struct console *co, const char *s, unsigned int count)
 {
 {
 	struct mtdoops_context *cxt = co->data;
 	struct mtdoops_context *cxt = co->data;
 	struct mtd_info *mtd = cxt->mtd;
 	struct mtd_info *mtd = cxt->mtd;
-	int i;
 
 
 	if (!oops_in_progress) {
 	if (!oops_in_progress) {
 		mtdoops_console_sync();
 		mtdoops_console_sync();
@@ -305,10 +304,8 @@ mtdoops_console_write(struct console *co, const char *s, unsigned int count)
 	if ((count + cxt->writecount) > OOPS_PAGE_SIZE)
 	if ((count + cxt->writecount) > OOPS_PAGE_SIZE)
 		count = OOPS_PAGE_SIZE - cxt->writecount;
 		count = OOPS_PAGE_SIZE - cxt->writecount;
 
 
-	for (i = 0; i < count; i++, s++)
-		*((char *)(cxt->oops_buf) + cxt->writecount + i) = *s;
-
-	cxt->writecount = cxt->writecount + count;
+	memcpy(cxt->oops_buf + cxt->writecount, s, count);
+	cxt->writecount += count;
 }
 }
 
 
 static int __init mtdoops_console_setup(struct console *co, char *options)
 static int __init mtdoops_console_setup(struct console *co, char *options)