Received: from eggs.gnu.org ([2001:4830:134:3::10]:47558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7hyc-00019n-EC for qemu-devel@nongnu.org; Tue, 31 May 2016 07:36:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7hyU-0000WQ-5i for qemu-devel@nongnu.org; Tue, 31 May 2016 07:36:50 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:48586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7hyT-0000Vy-Qw for qemu-devel@nongnu.org; Tue, 31 May 2016 07:36:42 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 May 2016 12:36:37 +0100 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Tue, 31 May 2016 13:36:05 +0200 Message-Id: <1464694565-16784-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH] m25p80: fix test on blk_pread() return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Peter Crosthwaite , Kevin Wolf , Max Reitz , qemu-block@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= commit 243e6f69c129 ("m25p80: Switch to byte-based block access") replaced blk_read() calls with blk_pread() but return values are different. Signed-off-by: Cédric Le Goater --- hw/block/m25p80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: qemu-ast2400-mainline.git/hw/block/m25p80.c =================================================================== --- qemu-ast2400-mainline.git.orig/hw/block/m25p80.c +++ qemu-ast2400-mainline.git/hw/block/m25p80.c @@ -900,7 +900,7 @@ static int m25p80_init(SSISlave *ss) s->storage = blk_blockalign(s->blk, s->size); /* FIXME: Move to late init */ - if (blk_pread(s->blk, 0, s->storage, s->size)) { + if (blk_pread(s->blk, 0, s->storage, s->size) != s->size) { fprintf(stderr, "Failed to initialize SPI flash!\n"); return 1; }