From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7kcu-000396-GY for qemu-devel@nongnu.org; Tue, 31 May 2016 10:26:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7kcq-0005Lc-AD for qemu-devel@nongnu.org; Tue, 31 May 2016 10:26:33 -0400 References: <1464694565-16784-1-git-send-email-clg@kaod.org> From: Eric Blake Message-ID: <574D9F0F.7060904@redhat.com> Date: Tue, 31 May 2016 08:26:23 -0600 MIME-Version: 1.0 In-Reply-To: <1464694565-16784-1-git-send-email-clg@kaod.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wSoaOwsQ2o3QUKsxIxFwjJsDHvPW5h7Jj" 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: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Cc: Peter Crosthwaite , Kevin Wolf , Max Reitz , qemu-block@nongnu.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wSoaOwsQ2o3QUKsxIxFwjJsDHvPW5h7Jj Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. Shoot, I completely missed that when I made the conversions. Now I need to re-audit that entire series to see if the same problem happened anywhere else. >=20 > Signed-off-by: C=C3=A9dric Le Goater > --- > hw/block/m25p80.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) 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 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wSoaOwsQ2o3QUKsxIxFwjJsDHvPW5h7Jj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXTZ8PAAoJEKeha0olJ0NqSQ8H/3BXUiBBTjb+GLGShdppgvcO 08UYVFXS0d8eLz6ep/oU5eOpXi97Mkc+Ga5e0S0PXjpCdhF+sO7RZ334hNWmbWRt l/V7EoU65wvXO7Y31Re+fZMeQ0g8RBThJyFunDBKcRELUoW1qVdj/lH3W1fqIanP jWGZ8B3wJrzd7NZHpPfvJNPn53w2v68M6fcL/3+3hx+KAswZvOKdTJH/wDz5xPZs ezp3Oz6Iiea84N3S4nOM7ErmHLeNVTk4MVeP9ZOweVSU7Ovk9B8kBZ5t3rvZ1A1J ETxY3Qf17936XXF8jKZWpXkMCVAw3un39TRVCCGK5VTMHt7aKEfjTQmWTa4ZTvY= =r96B -----END PGP SIGNATURE----- --wSoaOwsQ2o3QUKsxIxFwjJsDHvPW5h7Jj--