diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2007-11-06 05:56:02 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-12-03 09:00:16 -0500 |
commit | 235d6200ea63372935e097cb82e6a8c133d51cad (patch) | |
tree | b65b0d9f41b6295810806cba7f1f1105255ad02e /drivers/mtd | |
parent | 256331d53a40f436cd0b16166621d819923145c8 (diff) |
[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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | 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 f8af627f0b98..20eaf294f620 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) | |||
286 | { | 286 | { |
287 | struct mtdoops_context *cxt = co->data; | 287 | struct mtdoops_context *cxt = co->data; |
288 | struct mtd_info *mtd = cxt->mtd; | 288 | struct mtd_info *mtd = cxt->mtd; |
289 | int i; | ||
290 | 289 | ||
291 | if (!oops_in_progress) { | 290 | if (!oops_in_progress) { |
292 | mtdoops_console_sync(); | 291 | mtdoops_console_sync(); |
@@ -305,10 +304,8 @@ mtdoops_console_write(struct console *co, const char *s, unsigned int count) | |||
305 | if ((count + cxt->writecount) > OOPS_PAGE_SIZE) | 304 | if ((count + cxt->writecount) > OOPS_PAGE_SIZE) |
306 | count = OOPS_PAGE_SIZE - cxt->writecount; | 305 | count = OOPS_PAGE_SIZE - cxt->writecount; |
307 | 306 | ||
308 | for (i = 0; i < count; i++, s++) | 307 | memcpy(cxt->oops_buf + cxt->writecount, s, count); |
309 | *((char *)(cxt->oops_buf) + cxt->writecount + i) = *s; | 308 | cxt->writecount += count; |
310 | |||
311 | cxt->writecount = cxt->writecount + count; | ||
312 | } | 309 | } |
313 | 310 | ||
314 | static int __init mtdoops_console_setup(struct console *co, char *options) | 311 | static int __init mtdoops_console_setup(struct console *co, char *options) |