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

Viresh KUMAR viresh.kumar at st.com
Wed Jul 28 00:02:22 EDT 2010


On 7/28/2010 3:55 AM, Linus Walleij wrote:
> 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 */
> 

I thought that also, but i didn't like that. There is nothing wrong or
special in code. It is fine to do divisions the way it is done. So i didn't
give any comment here. You still want me to give a comment there?

viresh.



More information about the linux-arm-kernel mailing list