login
Header Space

 
 

Re: x86: Clean up computation of HPET .mult variables

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Daniel Walker <dwalker@...>
Cc: <linux-kernel@...>, <tglx@...>, <venkatesh.pallipadi@...>
Date: Tuesday, May 6, 2008 - 8:59 am

On Mon  5.May'08 at 20:23:38 -0700, Daniel Walker wrote:

So that would be a point in favour of using div_sc(), right?


Hmm, clocksource_period2mult() would be just a rename of div_sc(), see
for example how clocksource_hpet.mult is computed with my patch:

clocksource_hpet.mult = div_sc(hpet_period, FSEC_PER_NSEC, HPET_SHIFT);

However, hpet_clockevent.mult would also require the exchange of
the first two arguments, due to the different definition of 'mult' in
clockchips.h and clocksource.h

So I would like to ask if this different definition of mult 
variables in clockevent versus clocksource is intentional or not.

And do you agree that your first suggestion of using clocksource_hz2mult
makes the code a bit bigger due to the extra computation of the frequency?

My patch saves 49 bytes, and I thought that being careful in the code
comments would make this change a safe thing (because everyone will
understand how the computation is done and that there is a difference
in the definitions).


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Mon May 5, 7:11 pm)
Re: rtc-cmos.c: Build fix, Carlos R. Mafra, (Tue May 6, 2:51 pm)
Re: rtc-cmos.c: Build fix, Andrew Morton, (Wed May 7, 5:31 pm)
Re: rtc-cmos.c: Build fix, Ingo Molnar, (Fri May 9, 4:32 am)
Re: rtc-cmos.c: Build fix, Carlos R. Mafra, (Fri May 9, 8:33 am)
Re: rtc-cmos.c: Build fix, Ingo Molnar, (Wed May 7, 3:10 am)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 9:13 am)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Mon May 5, 7:58 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Mon May 5, 10:13 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Mon May 5, 11:23 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 8:59 am)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Tue May 6, 12:21 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 4:50 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Tue May 6, 10:17 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 11:39 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Wed May 7, 12:21 am)
speck-geostationary