public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <jacmet@sunsite.dk>
To: rpurdie@openedhand.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtdoops cleanup
Date: Wed, 21 Nov 2007 11:18:47 +0100	[thread overview]
Message-ID: <87lk8rgauw.fsf@macbook.be.48ers.dk> (raw)
In-Reply-To: <87wssvve0t.fsf@nanv.dk> (Peter Korsgaard's message of "Tue\, 06 Nov 2007 11\:56\:02 +0100")

>>>>> "Peter" == Peter Korsgaard <jacmet@sunsite.dk> writes:

Comments?

 Peter> Use memcpy instead of open coding a copy loop.
 Peter> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
 Peter> ---
 Peter>  drivers/mtd/mtdoops.c |    7 ++-----
 Peter>  1 files changed, 2 insertions(+), 5 deletions(-)

 Peter> diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
 Peter> index f8af627..20eaf29 100644
 Peter> --- a/drivers/mtd/mtdoops.c
 Peter> +++ b/drivers/mtd/mtdoops.c
 Peter> @@ -286,7 +286,6 @@ mtdoops_console_write(struct console *co, const char *s, unsigned int count)
 Peter>  {
 Peter>  	struct mtdoops_context *cxt = co->data;
 Peter>  	struct mtd_info *mtd = cxt->mtd;
 Peter> -	int i;
 
 Peter>  	if (!oops_in_progress) {
 Peter>  		mtdoops_console_sync();
 Peter> @@ -305,10 +304,8 @@ mtdoops_console_write(struct console *co, const char *s, unsigned int count)
 Peter>  	if ((count + cxt->writecount) > OOPS_PAGE_SIZE)
 Peter>  		count = OOPS_PAGE_SIZE - cxt->writecount;
 
 Peter> -	for (i = 0; i < count; i++, s++)
 Peter> -		*((char *)(cxt->oops_buf) + cxt->writecount + i) = *s;
 Peter> -
 Peter> -	cxt->writecount = cxt->writecount + count;
 Peter> +	memcpy(cxt->oops_buf + cxt->writecount, s, count);
 Peter> +	cxt->writecount += count;
 Peter>  }
 
 Peter>  static int __init mtdoops_console_setup(struct console *co, char *options)
 Peter> -- 
 Peter> 1.5.3.4

 Peter> -- 
 Peter> Bye, Peter Korsgaard

 Peter> ______________________________________________________
 Peter> Linux MTD discussion mailing list
 Peter> http://lists.infradead.org/mailman/listinfo/linux-mtd/


-- 
Bye, Peter Korsgaard

  reply	other threads:[~2007-11-21 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06 10:56 [PATCH] mtdoops cleanup Peter Korsgaard
2007-11-21 10:18 ` Peter Korsgaard [this message]
2007-11-21 13:20 ` Jörn Engel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lk8rgauw.fsf@macbook.be.48ers.dk \
    --to=jacmet@sunsite.dk \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rpurdie@openedhand.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox