From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeN1U-0002Ys-ED for qemu-devel@nongnu.org; Fri, 11 Mar 2016 08:22:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeN1S-00071z-JU for qemu-devel@nongnu.org; Fri, 11 Mar 2016 08:22:32 -0500 Received: from e06smtp09.uk.ibm.com ([195.75.94.105]:47602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeN1S-00070G-Ax for qemu-devel@nongnu.org; Fri, 11 Mar 2016 08:22:30 -0500 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 Mar 2016 13:22:28 -0000 References: <1457638209-14218-1-git-send-email-rutu.shah.26@gmail.com> <56E2AFA1.5010201@de.ibm.com> <56E2B4EA.4050305@redhat.com> <56E2B629.7080405@de.ibm.com> <56E2B984.2050300@redhat.com> From: Christian Borntraeger Message-ID: <56E2C68D.4010502@de.ibm.com> Date: Fri, 11 Mar 2016 14:22:21 +0100 MIME-Version: 1.0 In-Reply-To: <56E2B984.2050300@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Replacing (and removing) get_ticks_per_sec() function with NANOSECONDS_PER_SECOND Signed-off-by: Rutuja Shah List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , rutu.shah.26@gmail.com, qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, kvm@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, mark.cave-ayland@ilande.co.uk, lcapitulino@redhat.com, kraxel@redhat.com, qemu-block@nongnu.org, agraf@suse.de, samuel.thibault@ens-lyon.org, alistair.francis@xilinx.com, qemu-arm@nongnu.org, stefanha@redhat.com, cornelia.huck@de.ibm.com, jsnow@redhat.com, rth@twiddle.net, kwolf@redhat.com, crosthwaite.peter@gmail.com, armbru@redhat.com, blauwirbel@gmail.co, qemu-ppc@nongnu.org, imammedo@redhat.com On 03/11/2016 01:26 PM, Paolo Bonzini wrote: > > > On 11/03/2016 13:12, Christian Borntraeger wrote: >> On 03/11/2016 01:07 PM, Paolo Bonzini wrote: >>> >>> >>> On 11/03/2016 12:44, Christian Borntraeger wrote: >>>>> - s->tick_offset_vmstate = s->tick_offset + delta / get_ticks_per_sec(); >>>>>> + s->tick_offset_vmstate = s->tick_offset + delta / NANOSECONDS_PER_SECOND; >>>> [...] >>>> >>>> While technically correct, I do not like these changes. The interfaces expect "ticks", >>>> and the fact that this happens to be a nanosecond does not help regarding >>>> readability. >>> >>> Actually, I think usage of "tick" in this file is just for historical >>> reasons. >> >> So in essence the patch is ok and we should try to get rid of the "tick" word in future >> patches? > > Not necessarily. The patch stops overloading the word "tick", so that > "tick" means "whatever the timer device counts". > > In fact, you and I were both confused by the appearance of the word > "tick" in get_ticks_per_sec(). [...] > the plus meant nanoseconds. And I got confused *despite being the > author of that line* (commit b0f2663, "pl031: switch clock base to > rtc_clock", 2012-03-30). Given the confusion, the patch description should contain some of these examples and an explanation why this is the right thing to do.