From patchwork Thu Aug 15 13:55:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 267389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A21082C014F for ; Thu, 15 Aug 2013 23:56:52 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9y2Z-0004nQ-IR; Thu, 15 Aug 2013 13:56:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9y2V-0006zo-Oz; Thu, 15 Aug 2013 13:56:35 +0000 Received: from mail-pb0-x22a.google.com ([2607:f8b0:400e:c01::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9y2M-0006w2-DZ for linux-mtd@lists.infradead.org; Thu, 15 Aug 2013 13:56:27 +0000 Received: by mail-pb0-f42.google.com with SMTP id un15so745384pbc.15 for ; Thu, 15 Aug 2013 06:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RcyL1Hyp/ohEfD19gc034Xov9FUR9Jlf6rozG6wUa/g=; b=Mr/oYUuUgfryb/WhEJs0DRFZ5Tknd+lR28HSgW2IHOJMQ8mMTFxA1BqZ9zvgEnrGU1 mAej+k9zDuC3vvOjpPzCzg3cwWIXhFdSNajEpXDMUG4jLz+XH41dZwmDVztmcOxyxLRQ U+mWHdrPL9OkwhaJdsoYlucMmzN575fMwhlDQzlcerrnnMPS7Dp/PSm9Ub6GRseWgDWZ urMe2p3h1yhUUWZzUWeb/07K0BviWP4UnMkfcHN+XYowKli6RQC3Gwd+fHX+0B5FtKWP SEzYecqV4CWtgnUaCCOWqm1pfJlDSK6SewpaEL0RM2fxgOPSkYeCQrV2EMLQHLlTONCN gSHQ== X-Received: by 10.68.133.71 with SMTP id pa7mr15801991pbb.133.1376574964133; Thu, 15 Aug 2013 06:56:04 -0700 (PDT) Received: from localhost.localdomain (KD113145060135.ppp-bb.dion.ne.jp. [113.145.60.135]) by mx.google.com with ESMTPSA id yg1sm139476pbb.1.2013.08.15.06.56.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 06:56:03 -0700 (PDT) From: Akinobu Mita To: linux-mtd@lists.infradead.org Subject: [PATCH -next 2/4] mtd: tests: return -EIO when mtdtest_read() failed to read requested bytes Date: Thu, 15 Aug 2013 22:55:07 +0900 Message-Id: <1376574909-7507-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1376574909-7507-1-git-send-email-akinobu.mita@gmail.com> References: <1376574909-7507-1-git-send-email-akinobu.mita@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130815_095626_583632_1FA37EA6 X-CRM114-Status: GOOD ( 13.88 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (akinobu.mita[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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 Cc: Artem Bityutskiy , Vikram Narayanan , Akinobu Mita , Adrian Hunter , Brian Norris , David Woodhouse X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 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" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org mtdtest_read() returns -EINVAL if the number of bytes actually read is smaller than the number of bytes requested. But mtdtest_write() returns -EIO in the similar error condition and returning -EIO seems more appropriate than -EINVAL in this case. Signed-off-by: Akinobu Mita Cc: Brian Norris Cc: Vikram Narayanan Cc: Adrian Hunter Cc: Artem Bityutskiy Cc: David Woodhouse Cc: linux-mtd@lists.infradead.org --- drivers/mtd/tests/mtd_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/tests/mtd_test.c b/drivers/mtd/tests/mtd_test.c index 9e63896..bda8c4d 100644 --- a/drivers/mtd/tests/mtd_test.c +++ b/drivers/mtd/tests/mtd_test.c @@ -91,7 +91,7 @@ int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf) if (mtd_is_bitflip(err)) err = 0; if (!err && read != size) - err = -EINVAL; + err = -EIO; return err; }