Commit 235d6200 authored by Peter Korsgaard's avatar Peter Korsgaard Committed by David Woodhouse

[MTD] mtdoops cleanup

Use memcpy instead of open coding a copy loop.
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 256331d5
...@@ -286,7 +286,6 @@ mtdoops_console_write(struct console *co, const char *s, unsigned int count) ...@@ -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) ...@@ -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++) memcpy(cxt->oops_buf + cxt->writecount, s, count);
*((char *)(cxt->oops_buf) + cxt->writecount + i) = *s; cxt->writecount += count;
cxt->writecount = 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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment