From: Wanlong Gao <wanlong.gao@gmail.com>
To: dwmw2@infradead.org, akpm@linux-foundation.org
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Wanlong Gao <wanlong.gao@gmail.com>
Subject: [PATCH 2/2] driver:mtd:fix the bad format in the mtdcore.c
Date: Tue, 17 May 2011 22:36:19 +0800 [thread overview]
Message-ID: <1305642979-7419-2-git-send-email-wanlong.gao@gmail.com> (raw)
In-Reply-To: <1305642979-7419-1-git-send-email-wanlong.gao@gmail.com>
From: Wanlong Gao <wanlong.gao@gmail.com>
Fix the bad format in the mtdcore.c.
Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com>
---
drivers/mtd/mtdcore.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 9b7ad35..524e030 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -615,7 +615,7 @@ int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
if(!mtd->write) {
ret = -EROFS;
} else {
- for (i=0; i<count; i++) {
+ for (i = 0; i < count; i++) {
if (!vecs[i].iov_len)
continue;
ret = mtd->write(mtd, to, vecs[i].iov_len, &thislen, vecs[i].iov_base);
@@ -651,8 +651,8 @@ static struct proc_dir_entry *proc_mtd;
static inline int mtd_proc_info(char *buf, struct mtd_info *this)
{
return sprintf(buf, "mtd%d: %8.8llx %8.8x \"%s\"\n", this->index,
- (unsigned long long)this->size,
- this->erasesize, this->name);
+ (unsigned long long)this->size,
+ this->erasesize, this->name);
}
static int mtd_read_proc (char *page, char **start, off_t off, int count,
@@ -660,30 +660,30 @@ static int mtd_read_proc (char *page, char **start, off_t off, int count,
{
struct mtd_info *mtd;
int len, l;
- off_t begin = 0;
+ off_t begin = 0;
mutex_lock(&mtd_table_mutex);
len = sprintf(page, "dev: size erasesize name\n");
mtd_for_each_device(mtd) {
l = mtd_proc_info(page + len, mtd);
- len += l;
- if (len+begin > off+count)
- goto done;
- if (len+begin < off) {
- begin += len;
- len = 0;
- }
- }
+ len += l;
+ if (len + begin > off + count)
+ goto done;
+ if (len + begin < off) {
+ begin += len;
+ len = 0;
+ }
+ }
- *eof = 1;
+ *eof = 1;
done:
mutex_unlock(&mtd_table_mutex);
- if (off >= len+begin)
- return 0;
- *start = page + (off-begin);
- return ((count < begin+len-off) ? count : begin+len-off);
+ if (off >= len + begin)
+ return 0;
+ *start = page + (off - begin);
+ return ((count < begin + len - off) ? count : begin + len - off);
}
#endif /* CONFIG_PROC_FS */
--
1.7.4.1
next prev parent reply other threads:[~2011-05-17 14:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 14:36 [PATCH 1/2] driver:mtd:use the wrapped __get_mtd_device in get_mtd_device_nm Wanlong Gao
2011-05-17 14:36 ` Wanlong Gao [this message]
2011-05-20 5:38 ` [PATCH 2/2] driver:mtd:fix the bad format in the mtdcore.c Artem Bityutskiy
2011-05-20 5:34 ` [PATCH 1/2] driver:mtd:use the wrapped __get_mtd_device in get_mtd_device_nm Artem Bityutskiy
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=1305642979-7419-2-git-send-email-wanlong.gao@gmail.com \
--to=wanlong.gao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).