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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Carlos R. Mafra
Date: Tuesday, May 6, 2008 - 5: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, 4:11 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Mon May 5, 4:58 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Mon May 5, 7:13 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Mon May 5, 8:23 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 5:59 am)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 6:13 am)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Tue May 6, 9:21 am)
Re: rtc-cmos.c: Build fix, Carlos R. Mafra, (Tue May 6, 11:51 am)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 1:50 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Tue May 6, 7:17 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 8:39 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Tue May 6, 9:21 pm)
Re: rtc-cmos.c: Build fix, Ingo Molnar, (Wed May 7, 12:10 am)
Re: x86: Clean up computation of HPET .mult variables, Ingo Molnar, (Wed May 7, 12:13 am)
Re: rtc-cmos.c: Build fix, Andrew Morton, (Wed May 7, 2:31 pm)
Re: rtc-cmos.c: Build fix, Ingo Molnar, (Fri May 9, 1:32 am)
Re: rtc-cmos.c: Build fix, Carlos R. Mafra, (Fri May 9, 5:33 am)