From mboxrd@z Thu Jan 1 00:00:00 1970 From: viresh.kumar@st.com (Viresh KUMAR) Date: Wed, 28 Jul 2010 09:32:22 +0530 Subject: [PATCH] Watchdog: Adding support for ARM Primecell SP805 Watchdog In-Reply-To: References: <1274344428-28329-1-git-send-email-viresh.kumar@st.com> <4C43DD7E.5050800@st.com> <4C4E65A4.7030005@st.com> Message-ID: <4C4FABCE.70907@st.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 7/28/2010 3:55 AM, Linus Walleij wrote: > 2010/7/27 Viresh KUMAR : > >>>>>>> + /* 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.