[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/hpet: simplify hpet_get_channel()


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Fri, 23 Mar 2012 13:52:49 +0000
  • Cc: Gang Wei <gang.wei@xxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 23 Mar 2012 13:53:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac0I/DuzbNY9pyazM0eQUFfezQ94IQ==
  • Thread-topic: [Xen-devel] [PATCH] x86/hpet: simplify hpet_get_channel()

On 23/03/2012 10:46, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

>> Why is the following for-loop changed into do-while? It looks like it just
>> makes the code longer, especially as you replace a % operator with
>> open-coded equivalent for no reason I can see.
> 
> Simply because
> 
>     for ( i = next; i != next; ++i )
> 
> makes no sense.
> 
> Removing the % is an efficiency thing - the resulting code is not only
> faster, but also smaller (presumably because of the special register
> limitations div has).

Does that matter? It's the last thing done before going into deep sleep.

I suppose I don't mind that much, the whole thing just seems to make the C
code longer.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.