From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axV2f-0001L1-5g for qemu-devel@nongnu.org; Tue, 03 May 2016 03:46:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axV2T-0002uQ-E2 for qemu-devel@nongnu.org; Tue, 03 May 2016 03:46:43 -0400 Date: Tue, 3 May 2016 09:45:56 +0200 From: Kevin Wolf Message-ID: <20160503074556.GA3917@noname.str.redhat.com> References: <1461960516-4717-1-git-send-email-eblake@redhat.com> <1461960516-4717-4-git-send-email-eblake@redhat.com> <20160502153511.GC4882@noname.redhat.com> <5727C21C.6020504@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <5727C21C.6020504@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 03/14] nand: Switch to byte-based block access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, "open list:Block layer core" , Max Reitz --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 02.05.2016 um 23:09 hat Eric Blake geschrieben: > On 05/02/2016 09:35 AM, Kevin Wolf wrote: > > Am 29.04.2016 um 22:08 hat Eric Blake geschrieben: > >> Sector-based blk_write() should die; switch to byte-based > >> blk_pwrite() instead. Likewise for blk_read(). > >> > >> This file is doing some complex computations to map various > >> flash page sizes (256, 512, and 2048) atop generic uses of > >> 512-byte sector operations. Perhaps someone will want to tidy > >> up the file for fewer gymnastics in managing addresses and > >> offsets, and less wasteful visits of 256-byte pages, but it > >> was out of scope for this series, where I just went with the > >> mechanical conversion. > >> > >> Signed-off-by: Eric Blake > >> --- > >> hw/block/nand.c | 36 +++++++++++++++++++++++------------- > >> 1 file changed, 23 insertions(+), 13 deletions(-) > >> > >> diff --git a/hw/block/nand.c b/hw/block/nand.c > >> index 29c6596..2703ff4 100644 > >> --- a/hw/block/nand.c >=20 > >> } else { > >> off =3D PAGE_START(s->addr) + (s->addr & PAGE_MASK) + s->offs= et; > >> sector =3D off >> 9; > >> soff =3D off & 0x1ff; > >> - if (blk_read(s->blk, sector, iobuf, PAGE_SECTORS + 2) < 0) { > >> + if (blk_pread(s->blk, sector << BDRV_SECTOR_BITS, iobuf, > >> + (PAGE_SECTORS + 2) << BDRV_SECTOR_BITS) < 0) { >=20 > Botched indentation here, too. >=20 > >> printf("%s: read error in sector %" PRIu64 "\n", __func__= , sector); > >> return; > >> } > >> > >> mem_and(iobuf + soff, s->io, s->iolen); > >> > >> - if (blk_write(s->blk, sector, iobuf, PAGE_SECTORS + 2) < 0) { > >> + if (blk_write(s->blk, sector << BDRV_SECTOR_BITS, iobuf, > >> + (PAGE_SECTORS + 2) << BDRV_SECTOR_BITS, 0) < 0)= { > >=20 > > You forgot to actually change which function is called here. >=20 > I _did_ warn that some of my patches were not compile tested (wonder why > I forgot to warn on this one, when I did warn on 4/14). Of course, > patch 14/14 would have caused a compile error if I had been compiling > this. So, what exactly do I need to start compiling these files, and > ensure I'm not doing dead code edits? I just did a full compile (i.e. no --target-list), that covered it. This is the only thing I saw, though maybe I missed a warning because somehow -Werror didn't seem to be in effect. I did the test build with clang, maybe configure behaves different there. Kevin --oyUTqETQ0mS9luUI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXKFc0AAoJEH8JsnLIjy/WBKUQAJX0yJkT3u4DCi3wV/tEV+Ed A04pNN/dHMJbZZ8SrpWmxlDe+yujNbHLgrbBK/9PPEmiRCxUpa6M2/jg32MnpLrJ cOPvyXG0kVPbY1fwGm2DeZVEqA42XDZlZoWYGWqweeSU+Fe3Ng6P9nrhaLORJ0JB qSljw94ffOJS6RrAyR3uSD7bVusjrL0wjJuOKlyvn/jl/TB1z03n0h/xmOVEhxpE /0xsUp4KY1q8n3w1lQ1ZegvBYIf4TQ1uzKcF9/7uiiFVKPQsVqKm175PALXG6B4/ DMvykLpx37d2vARzAq2CgxisB1tdxR6Tja/v4K9dNg+2nl+IIY2vIzrrHJKz0Hh9 5Un0fCNF1FW7Fpe3LpLeqxIz8QqWjmMrpzhzT9RF6NTRgLtj32dzk+5wjTHuIyof 3emE/LnGvMKh7L9HUdKNsr3uAefKHQCfoh6yb4yjpnkOK6UqgNqehzPuBxvSneQb R0TC3tBEyZWCzdhLTR199LsG6qHQIqCFDRxEVUYJ1YOfgm0ikx9TISvIkr6hnQBA S7WZBfZ+6zaDPuDUlBm1DmD2ujdq16exHtJZrRxaEp+H/2jw9ypzJwjF6JcaEQYZ JSk5RTLEhbCk0yJEW4z8+Gac+KZVC1Pgf+yugYrIvZcz0ndZPNtE64/St1e6uCdF JtNuAAEs93N0J8qsrXo1 =WuaL -----END PGP SIGNATURE----- --oyUTqETQ0mS9luUI--