From patchwork Tue May 17 14:36:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wanlong.gao@gmail.com X-Patchwork-Id: 95944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 03B4DB6EDF for ; Wed, 18 May 2011 00:38:07 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QMLOT-0004yk-DD; Tue, 17 May 2011 14:37:05 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QMLOR-0008Eg-KI; Tue, 17 May 2011 14:37:03 +0000 Received: from mail-pz0-f49.google.com ([209.85.210.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QMLON-0008D8-QO for linux-mtd@lists.infradead.org; Tue, 17 May 2011 14:37:01 +0000 Received: by mail-pz0-f49.google.com with SMTP id 28so297686pzk.36 for ; Tue, 17 May 2011 07:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=Fl8yUOuTIS+gqXYIFMtXkFIoGqUVGAJI4gPcmaWoT5U=; b=Reh820bhdlCSLaKuxIw3Dvz5kQVv1tzW8Xz16FWr/bA/Mn9olRhWcS+zboxeUk0I6U zrBQASHh6sKC4B5rbMBmGyHA8Sl10a9UzcAf7kzfF1JVTYHsm8+1EXdZDaKJ5tJJnoCi evgJ9bsgGcTpwyOtL7rc6uTJlOiZWOPWwCi/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=ecSKcvLh8IN0mpB1DJ4UssGVZZ+aXVGn4D0rj9E0x7X91bT+Ekvdh2tckgbszvB+m/ MANT0um0rR6t8BlTSDf2eI2AkfdpMpVUBMIU8VZ7cqkdL52uXYbg/TEaJITQ2p8XFLnP W8kgWRRKXkNDn/XV1U6SZse3Tr16qjLN2mFUE= Received: by 10.68.14.102 with SMTP id o6mr1243740pbc.124.1305643019407; Tue, 17 May 2011 07:36:59 -0700 (PDT) Received: from localhost.localdomain ([182.32.131.175]) by mx.google.com with ESMTPS id t4sm408023pbl.45.2011.05.17.07.36.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2011 07:36:58 -0700 (PDT) From: Wanlong Gao To: dwmw2@infradead.org, akpm@linux-foundation.org Subject: [PATCH 2/2] driver:mtd:fix the bad format in the mtdcore.c Date: Tue, 17 May 2011 22:36:19 +0800 Message-Id: <1305642979-7419-2-git-send-email-wanlong.gao@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1305642979-7419-1-git-send-email-wanlong.gao@gmail.com> References: <1305642979-7419-1-git-send-email-wanlong.gao@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110517_103700_219691_2EC57D4B X-CRM114-Status: GOOD ( 16.59 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (wanlong.gao[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL Cc: Wanlong Gao , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Wanlong Gao Fix the bad format in the mtdcore.c. Signed-off-by: Wanlong Gao --- 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; iwrite(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 */