From patchwork Sun Mar 25 21:47:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 148588 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1B4CDB6EF3 for ; Mon, 26 Mar 2012 08:49:16 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SBvHs-0004nX-Jq; Sun, 25 Mar 2012 21:47:44 +0000 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SBvHo-0004nJ-F1 for linux-mtd@lists.infradead.org; Sun, 25 Mar 2012 21:47:42 +0000 Received: from beldin.local (unknown [IPv6:2a01:e35:2f37:a360:7a92:9cff:fe2d:4ee]) by smtp1-g21.free.fr (Postfix) with ESMTP id 58D9C9400AC; Sun, 25 Mar 2012 23:47:31 +0200 (CEST) From: Robert Jarzmik To: Artem Bityutskiy Subject: Fix docg3 read align bug X-URL: http://belgarath.falguerolles.org/ Date: Sun, 25 Mar 2012 23:47:29 +0200 Message-ID: <87haxcs68e.fsf@free.fr> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robert.jarzmik[at]free.fr) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linux mtd X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi Artem, I sent not long ago a patch for unaligned reads. And ... I made an error. I have a patch to patch my previous submission. I wonder if this can be squashed in, or requires an incremental commit. Tell me what you want to do, the patch is at the end of the mail. I hope I have not overseen another corner case, I'll recheck tomorrow evening (GMT+1). Cheers. diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index 7ced089..8272c02 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c @@ -893,7 +893,8 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t from, ret = doc_read_page_getbytes(docg3, nbdata, buf, 0); if (ret < nbdata) goto err_in_read; - doc_read_page_getbytes(docg3, DOC_LAYOUT_PAGE_SIZE - nbdata, + doc_read_page_getbytes(docg3, + DOC_LAYOUT_PAGE_SIZE - nbdata - skip, NULL, 0); ret = doc_read_page_getbytes(docg3, nboob, oobbuf, 0); if (ret < nboob)