From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRrkv-0003cR-NB for qemu-devel@nongnu.org; Mon, 04 Jan 2010 13:34:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRrkq-0003YL-O1 for qemu-devel@nongnu.org; Mon, 04 Jan 2010 13:34:17 -0500 Received: from [199.232.76.173] (port=36379 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRrkq-0003Xq-Dx for qemu-devel@nongnu.org; Mon, 04 Jan 2010 13:34:12 -0500 Received: from mail-gx0-f223.google.com ([209.85.217.223]:34059) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRrkq-0006YS-1v for qemu-devel@nongnu.org; Mon, 04 Jan 2010 13:34:12 -0500 Received: by gxk23 with SMTP id 23so16955341gxk.2 for ; Mon, 04 Jan 2010 10:34:11 -0800 (PST) Message-ID: <4B4242A8.2020305@codemonkey.ws> Date: Mon, 04 Jan 2010 13:34:00 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 03/19] avoid dubiously clever code in win32_start_timer References: <1261382970-23251-1-git-send-email-pbonzini@redhat.com> <1261382970-23251-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1261382970-23251-4-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 12/21/2009 02:09 AM, Paolo Bonzini wrote: > The code is initializing an unsigned int to UINT_MAX using "-1", so that > the following always-true comparison seems to be always-false at a > first look. Just remove the if. This really needs a better comment message as at first it wasn't obvious to me that this was correct. start_timer is only ever called once and as such, the check here is unnecessary. It's not incorrect, it's just more robust than it needs to be. I'm not sure it's really worth removing to be honest. Regards, Anthony Liguori