[PATCH] Watchdog: Adding support for ARM Primecell SP805 Watchdog

Linus Walleij linus.ml.walleij at gmail.com
Tue Jul 27 18:25:20 EDT 2010


2010/7/27 Viresh KUMAR <viresh.kumar at st.com>:

>>>> >> +       /* roundup timeout to closest positive integer value */
>>>> >> +       wdt->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
>>> >
>>> > Look in linux/kernel.h, use the
>>> > DIV_ROUND_CLOSEST() macro instead of this.
>
> Now i remember why i didn't choose DIV_ROUND_CLOSEST in V1 of this patch.
> As it is a u64 division, i get following compilation error if i use
> DIV_ROUND_CLOSEST. I wasn't sure if inclusion of some header file can remove
> this error, and so i used div_u64.

Aha, I have no solution to that, but I'd recommend adding the comment
/* Cannot use DIV_ROUND_CLOSEST() due to the 64bit size */

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list