From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7nof-0003TL-Rb for qemu-devel@nongnu.org; Tue, 31 May 2016 13:50:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7noe-0006Ph-P1 for qemu-devel@nongnu.org; Tue, 31 May 2016 13:50:57 -0400 References: <1464712565-14857-1-git-send-email-lvivier@redhat.com> <1464712565-14857-6-git-send-email-lvivier@redhat.com> From: Eric Blake Message-ID: <574DCEFA.70906@redhat.com> Date: Tue, 31 May 2016 11:50:50 -0600 MIME-Version: 1.0 In-Reply-To: <1464712565-14857-6-git-send-email-lvivier@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KSuN9mNN5PQDbtOihbkaGwnbj6of5XV8K" Subject: Re: [Qemu-devel] [PATCH 05/16] block: Use DIV_ROUND_UP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-trivial@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KSuN9mNN5PQDbtOihbkaGwnbj6of5XV8K Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/31/2016 10:35 AM, Laurent Vivier wrote: > Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d). >=20 > This patch is the result of coccinelle script > scripts/coccinelle/round.cocci >=20 > CC: qemu-block@nongnu.org > Signed-off-by: Laurent Vivier > --- > block/vvfat.c | 3 +-- > hw/block/tc58128.c | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/block/vvfat.c b/block/vvfat.c > index a39dbe6..6d2e21c 100644 > --- a/block/vvfat.c > +++ b/block/vvfat.c > @@ -1960,8 +1960,7 @@ DLOG(fprintf(stderr, "check direntry %d:\n", i); = print_direntry(direntries + i)) > /* check file size with FAT */ > cluster_count =3D get_cluster_count_for_direntry(s, direntries + i, = path2); > if (cluster_count !=3D > - (le32_to_cpu(direntries[i].size) + s->cluster_size > - - 1) / s->cluster_size) { > + DIV_ROUND_UP(le32_to_cpu(direntries[i].size), s->cluster_s= ize)) { The tab-vs.-space issues in this file make the patch look weird. It's not your fault, but you may want to manually touch up the result so that visual indentation under 8-spaces-per-tab still looks okay. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KSuN9mNN5PQDbtOihbkaGwnbj6of5XV8K 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/ iQEcBAEBCAAGBQJXTc76AAoJEKeha0olJ0NqwPMH/109sZcR32jQZgavwQSmpANX ML1AEFzftECN2c1efKo3bSVXEhw/yGTViYPhyAsAmzbwa2HHjA5LBc1ashyaDHGi 29BYq//mw73OLg+W9lWbA1PAEvFlUZ5E3MpQcOFh+9EqGSCIrb9gg9AqkP0nnCNi pOSNIkrgLX5CFZUuC7sAwJaEspe4CIw0tmahZsdZb1Bmomtj+ynIo9ljcJ9U5TWl Qk5Zzt2NjQWDgiLPqBvyuZh0Ipsn3jIAHOeRcPmeg2oZ+RZmDtBCkvaUIBbtr6+7 kNfmPHRiEbb9gHqupiPznBVJF/zIR0tc0HtvyMM41boh7TkcKgtnUvVPA3gkWdM= =Z23M -----END PGP SIGNATURE----- --KSuN9mNN5PQDbtOihbkaGwnbj6of5XV8K--