From patchwork Tue May 31 11:36:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 9144437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2E39C60761 for ; Tue, 31 May 2016 11:39:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EF1E27BF0 for ; Tue, 31 May 2016 11:39:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13A7A28188; Tue, 31 May 2016 11:39:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B149627BF0 for ; Tue, 31 May 2016 11:39:03 +0000 (UTC) Received: from localhost ([::1]:35985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7i0k-0002lz-9c for patchwork-qemu-devel@patchwork.kernel.org; Tue, 31 May 2016 07:39:02 -0400 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 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 31 May 2016 12:36:28 +0100 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: clg@kaod.org X-IBM-RcptTo: qemu-block@nongnu.org;qemu-devel@nongnu.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 401D917D8042; Tue, 31 May 2016 12:37:34 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u4VBaRUg19595714; Tue, 31 May 2016 11:36:27 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u4VBaRfA025884; Tue, 31 May 2016 05:36:27 -0600 Received: from smtp.lab.toulouse-stg.fr.ibm.com (srv01.lab.toulouse-stg.fr.ibm.com [9.101.4.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u4VBaRtB025872; Tue, 31 May 2016 05:36:27 -0600 Received: from hermes.lab.toulouse-stg.fr.ibm.com (hermes.lab.toulouse-stg.fr.ibm.com [9.101.4.42]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id DA6F1220504; Tue, 31 May 2016 13:36:26 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Eric Blake Date: Tue, 31 May 2016 13:36:05 +0200 Message-Id: <1464694565-16784-1-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16053111-0021-0000-0000-00003C1F05CF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.111 Subject: [Qemu-devel] [PATCH] m25p80: fix test on blk_pread() return value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Peter Crosthwaite , qemu-devel@nongnu.org, Max Reitz , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Eric Blake --- 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; }