From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7kg0-0005iK-Bq for qemu-devel@nongnu.org; Tue, 31 May 2016 10:29:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7kfs-0005pz-AO for qemu-devel@nongnu.org; Tue, 31 May 2016 10:29:47 -0400 Received: from 18.mo6.mail-out.ovh.net ([46.105.73.110]:42788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7kfs-0005pj-3N for qemu-devel@nongnu.org; Tue, 31 May 2016 10:29:40 -0400 Received: from player756.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id E3800FFCEFA for ; Tue, 31 May 2016 16:29:38 +0200 (CEST) References: <1464694565-16784-1-git-send-email-clg@kaod.org> <574D9F0F.7060904@redhat.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <574D9FBB.60100@kaod.org> Date: Tue, 31 May 2016 16:29:15 +0200 MIME-Version: 1.0 In-Reply-To: <574D9F0F.7060904@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [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 On 05/31/2016 04:26 PM, Eric Blake wrote: > On 05/31/2016 05:36 AM, C=C3=A9dric Le Goater wrote: >> commit 243e6f69c129 ("m25p80: Switch to byte-based block access") >> replaced blk_read() calls with blk_pread() but return values are >> different. >=20 > Shoot, I completely missed that when I made the conversions. Now I nee= d > to re-audit that entire series to see if the same problem happened > anywhere else. I took a quick look and most of the calls to blk_pread() test with < 0.=20 So we should be fine and I should have mention that. C.=20 >> >> Signed-off-by: C=C3=A9dric Le Goater >> --- >> hw/block/m25p80.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > Reviewed-by: Eric Blake >=20 >> >> Index: qemu-ast2400-mainline.git/hw/block/m25p80.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- 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 =3D blk_blockalign(s->blk, s->size); >> =20 >> /* 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) !=3D s->size) { >> fprintf(stderr, "Failed to initialize SPI flash!\n"); >> return 1; >> } >> >> >=20