From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm3KM-0008RP-MM for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:26:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm3KI-0008Pl-0J for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:26:02 -0400 Received: from [199.232.76.173] (port=34984 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm3KH-0008Pg-Ql for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:25:57 -0400 Received: from mx20.gnu.org ([199.232.41.8]:10560) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mm3KH-00053v-B1 for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:25:57 -0400 Received: from goliath.siemens.de ([192.35.17.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mm3KF-0007b0-LL for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:25:56 -0400 Message-ID: <4AAA25BD.7040700@siemens.com> Date: Fri, 11 Sep 2009 12:26:05 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4AAA1293.1080408@siemens.com> <4AAA1A3E.6080408@siemens.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 05/26] Unexport ticks_per_sec variable. Create get_ticks_per_sec() function List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: "qemu-devel@nongnu.org" Juan Quintela wrote: > Jan Kiszka wrote: >> Juan Quintela wrote: >>> Jan Kiszka wrote: >>>> Juan Quintela wrote: >>>>> Signed-off-by: Juan Quintela >>>> [...] >>>> >>>>> diff --git a/vl.c b/vl.c >>>>> index 448ec6c..33abef2 100644 >>>>> --- a/vl.c >>>>> +++ b/vl.c >>>>> @@ -186,7 +186,7 @@ enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; >>>>> static DisplayState *display_state; >>>>> DisplayType display_type = DT_DEFAULT; >>>>> const char* keyboard_layout = NULL; >>>>> -int64_t ticks_per_sec; >>>>> +static int64_t ticks_per_sec; >>>>> ram_addr_t ram_size; >>>>> int nb_nics; >>>>> NICInfo nd_table[MAX_NICS]; >>>>> @@ -1032,6 +1032,11 @@ int64_t qemu_get_clock(QEMUClock *clock) >>>>> } >>>>> } >>>>> >>>>> +int64_t get_ticks_per_sec(void) >>>>> +{ >>>>> + return ticks_per_sec; >>>>> +} >>>>> + >>>> This refactoring would be even more useful if that one became >>>> >>>> static inline int64_t get_ticks_per_sec(void) >>>> { >>>> return QEMU_CLOCK_BASE; >>>> } >>>> >>>> Right now we don't have a use for the ticks_per_sec /variable/, it's >>>> always constant. Your interface does not prevent changing this in the >>>> future, though, which is just like it should be. >>> I liked this one on top. >> Why? > > Because that is how we use it. Mine is refactoring, yours is changing > behavior. With my patch, it is still possible to change ticks_per_sec > (not that this is a good idea, but that is how the code is today). With > yours, you remove that feature. I fully agree with your change. > In my book that are _two_ patches. Ah, ok, misunderstanding on my side (I'm a bit slow today). Will file a patch on top of yours. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux