On Apr 20, 2008, at 6:28 PM, Wolfgang Denk wrote: > In message <[EMAIL PROTECTED]> > you wrote: >> eg. because of rounding error we can get 799Mhz instead of 800Mhz. >> >> Signed-off-by: Dejan Minic <[EMAIL PROTECTED]> >> Signed-off-by: Srikanth Srinivasan >> <[EMAIL PROTECTED]> >> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]> >> --- >> cpu/mpc85xx/cpu.c | 18 +++++++++++------- >> 1 files changed, 11 insertions(+), 7 deletions(-) >> >> diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c >> index dcd8817..6972bb1 100644 >> --- a/cpu/mpc85xx/cpu.c >> +++ b/cpu/mpc85xx/cpu.c >> @@ -65,6 +65,11 @@ struct cpu_type cpu_type_list [] = { >> CPU_TYPE_ENTRY(8572_E), >> }; >> >> +static inline unsigned long integer_round (unsigned long val, >> unsigned long div) >> +{ >> + return ((val + (div/2)) / div); >> +} >> + > > As already mentioned, "integer_round" is not a good name for this. > Also, it seems this should not live in cpu/mpc85xx/cpu.c but in a > more central place and be used by lots of other code as well. > Actually you might want to make it a macro to allow for different > data types as well.
Ok. I've posted v3 of the patch that takes DIV_ROUND_UP from the kernel. See if that works for you. - k ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users