public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtdoops cleanup
@ 2007-11-06 10:56 Peter Korsgaard
  2007-11-21 10:18 ` Peter Korsgaard
  2007-11-21 13:20 ` Jörn Engel
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Korsgaard @ 2007-11-06 10:56 UTC (permalink / raw)
  To: rpurdie, linux-mtd

Use memcpy instead of open coding a copy loop.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 drivers/mtd/mtdoops.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index f8af627..20eaf29 100644
--- a/drivers/mtd/mtdoops.c
+++ b/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 mtd_info *mtd = cxt->mtd;
-	int i;
 
 	if (!oops_in_progress) {
 		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)
 		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)
-- 
1.5.3.4

-- 
Bye, Peter Korsgaard

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-21 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-06 10:56 [PATCH] mtdoops cleanup Peter Korsgaard
2007-11-21 10:18 ` Peter Korsgaard
2007-11-21 13:20 ` Jörn Engel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox