From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtozH-0004Nj-Oj for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:43:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtozF-0002Pd-0S for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:43:51 -0500 Date: Wed, 4 Nov 2015 14:22:51 +1100 From: David Gibson Message-ID: <20151104032251.GK21954@voom.redhat.com> References: <1445608598-24485-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1445608598-24485-12-git-send-email-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W2ydbIOJmkm74tJ2" Content-Disposition: inline In-Reply-To: <1445608598-24485-12-git-send-email-mark.cave-ayland@ilande.co.uk> Subject: Re: [Qemu-devel] [PATCH 11/13] cuda.c: rename get_counter() state variable from s to ti for consistency List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: cormac@c-obrien.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de --W2ydbIOJmkm74tJ2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 23, 2015 at 02:56:36PM +0100, Mark Cave-Ayland wrote: > Signed-off-by: Mark Cave-Ayland There are some other functions that also use 's' instead of 'ti', but I don't think that's a reason not to improve consistency in one place. Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) >=20 > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c > index 7a1b10b..687cb54 100644 > --- a/hw/misc/macio/cuda.c > +++ b/hw/misc/macio/cuda.c > @@ -148,7 +148,7 @@ static uint64_t get_tb(uint64_t time, uint64_t freq) > return muldiv64(time, freq, get_ticks_per_sec()); > } > =20 > -static unsigned int get_counter(CUDATimer *s) > +static unsigned int get_counter(CUDATimer *ti) > { > int64_t d; > unsigned int counter; > @@ -156,19 +156,19 @@ static unsigned int get_counter(CUDATimer *s) > uint64_t current_time =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); > =20 > /* Reverse of the tb calculation algorithm that Mac OS X uses on boo= tup. */ > - tb_diff =3D get_tb(current_time, s->frequency) - s->load_time; > - d =3D (tb_diff * 0xBF401675E5DULL) / (s->frequency << 24); > + tb_diff =3D get_tb(current_time, ti->frequency) - ti->load_time; > + d =3D (tb_diff * 0xBF401675E5DULL) / (ti->frequency << 24); > =20 > - if (s->index =3D=3D 0) { > + if (ti->index =3D=3D 0) { > /* the timer goes down from latch to -1 (period of latch + 2) */ > - if (d <=3D (s->counter_value + 1)) { > - counter =3D (s->counter_value - d) & 0xffff; > + if (d <=3D (ti->counter_value + 1)) { > + counter =3D (ti->counter_value - d) & 0xffff; > } else { > - counter =3D (d - (s->counter_value + 1)) % (s->latch + 2); > - counter =3D (s->latch - counter) & 0xffff; > + counter =3D (d - (ti->counter_value + 1)) % (ti->latch + 2); > + counter =3D (ti->latch - counter) & 0xffff; > } > } else { > - counter =3D (s->counter_value - d) & 0xffff; > + counter =3D (ti->counter_value - d) & 0xffff; > } > return counter; > } --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --W2ydbIOJmkm74tJ2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWOXoLAAoJEGw4ysog2bOS3dgP/RXQ/MI21eP8GfWJMi/0JCou 3Dl75bwknmctdKj2jjr9V2XR3ERj46vhDTL5Qh2j1w6iQ0NnvEcgmQEW2Yhtg218 NNhjWSwJYEQ5jUqnS89yH9FJKN9tz9+3NQ4nq+Kj79x0YgeBoi0tZJ+rFyqoXaLs LmWRbCPqUx17xcMOxvOa1DLKDV0rXxn8T2cLXTLa66HygnZujI4yYtYgY6w4OcBs tL8hNqBg9qxh3k+k8LPi8a0hisnB4F1+e1NTAdO1tvOlSJkF+BjJzDeelTbixOrT UlwgrAUb9HlO35ZkqItbQ/0QBXk2wfc2FCH9MzRjJvtrZCqyKtmD7HZ3uVORkBIS sNH624h0OamaNsvimbRGiWChFEbRdS4qFkbK5k0A/9jUJvUf4tOde5vkZgm9nwVD 5Vd0QoxPrRUSM4XrZUJVE5LCbPpUXRM/qXsDHdFnyP9FByoU29bAOOznIF6H9HyM mP//KU7xUIWSD9P88SEEfywj+VU7TUuhRIyOfeB6zTREZ9MOhgKfj7b5i4/42Otx bodHFmgOxLmqT9Tred9uHXggJz8Er93Ut/gTw8EUG6iWLIRiMOzNZfLkG5QdxcGT 4dOccY6TlwQ/ESUVJFJU7k0VNfRvw43ZjQ5/nfO2vq2957563SFc+W0D5AXIYq3E sHTtaHKFdfrhCJJnf0wP =WbKa -----END PGP SIGNATURE----- --W2ydbIOJmkm74tJ2--