From: Artem Bityutskiy <dedekind@infradead.org>
To: Jehan Bing <jehan@orb.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH 1/3] [MTD-UTILS] Unified reading from standard input and from file
Date: Wed, 10 Jun 2009 19:03:34 +0300 [thread overview]
Message-ID: <1244649814.5847.404.camel@localhost.localdomain> (raw)
In-Reply-To: <h0mppp$7v2$1@ger.gmane.org>
On Tue, 2009-06-09 at 16:04 -0700, Jehan Bing wrote:
> - readlen = meminfo.writesize;
>
> - if (ifd != STDIN_FILENO) {
> - int tinycnt = 0;
> -
> - if (pad && (imglen < readlen))
> - {
> - readlen = imglen;
> - erase_buffer(writebuf + readlen, meminfo.writesize - readlen);
> - }
> + {
> + readlen = meminfo.writesize;
>
Err, why do you need these spare { } ?
> - /* Read Page Data from input file */
> - while(tinycnt < readlen) {
> - cnt = read(ifd, writebuf + tinycnt, readlen - tinycnt);
> - if (cnt == 0) { // EOF
> - break;
> - } else if (cnt < 0) {
> - perror ("File I/O error on input file");
> - goto closeall;
> - }
> - tinycnt += cnt;
> - }
> - } else {
> int tinycnt = 0;
Err, is it normal C do do stuff like
{
readlen = meminfo.writesize;
int tinycnt += cnt;
? I think this is C++.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
next prev parent reply other threads:[~2009-06-10 16:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-08 22:32 [PATCH] [MTD-UTILS] Bad block handling in nandwrite when reading from standard input Jehan Bing
2009-06-09 12:53 ` Artem Bityutskiy
2009-06-09 17:15 ` Jehan Bing
2009-06-09 23:04 ` [PATCH 1/3] [MTD-UTILS] Unified reading from standard input and from file Jehan Bing
2009-06-10 16:03 ` Artem Bityutskiy [this message]
2009-06-10 16:05 ` Artem Bityutskiy
2009-06-10 17:23 ` Jamie Lokier
2009-06-10 17:11 ` Jehan Bing
2009-06-11 7:32 ` Artem Bityutskiy
2009-06-11 17:43 ` [PATCH 1/3 v2] " Jehan Bing
2009-06-12 5:30 ` Artem Bityutskiy
2009-06-09 23:07 ` [PATCH 2/3] [MTD-UTILS] Use same kind of code for reading OOB than for regular data Nahor
2009-06-09 23:19 ` [PATCH 3/3] [MTD-UTILS] Handle bad block when reading from standard input Jehan Bing
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=1244649814.5847.404.camel@localhost.localdomain \
--to=dedekind@infradead.org \
--cc=jehan@orb.com \
--cc=linux-mtd@lists.infradead.org \
/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