From: viresh.kumar@st.com (Viresh KUMAR)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Watchdog: Adding support for ARM Primecell SP805 Watchdog
Date: Wed, 28 Jul 2010 09:32:22 +0530 [thread overview]
Message-ID: <4C4FABCE.70907@st.com> (raw)
In-Reply-To: <AANLkTiktDfvRUjA-Scu643=GniuNzqKjNFBZY2foh_fa@mail.gmail.com>
On 7/28/2010 3:55 AM, Linus Walleij wrote:
> 2010/7/27 Viresh KUMAR <viresh.kumar@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.
next prev parent reply other threads:[~2010-07-28 4:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-20 8:33 [PATCH] Watchdog: Adding support for ARM Primecell SP805 Watchdog Viresh KUMAR
2010-06-02 7:48 ` Russell King - ARM Linux
2010-06-02 7:57 ` Viresh KUMAR
2010-07-18 20:29 ` Linus Walleij
2010-07-19 5:07 ` Viresh KUMAR
2010-07-27 4:50 ` Viresh KUMAR
2010-07-27 22:25 ` Linus Walleij
2010-07-28 4:02 ` Viresh KUMAR [this message]
2010-07-28 23:14 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C4FABCE.70907@st.com \
--to=viresh.kumar@st.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.