Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=235d6200ea63372935e097cb82e6a8c133d51cad
Commit:     235d6200ea63372935e097cb82e6a8c133d51cad
Parent:     256331d53a40f436cd0b16166621d819923145c8
Author:     Peter Korsgaard <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 6 11:56:02 2007 +0100
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Mon Dec 3 14:00:16 2007 +0000

    [MTD] mtdoops cleanup
    
    Use memcpy instead of open coding a copy loop.
    
    Signed-off-by: Peter Korsgaard <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to