From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 24 Oct 2008 13:30:41 +0200 Subject: [U-Boot] [PATCH] ARM: Use do_div() instead of division for "long long". In-Reply-To: <1224658841-14858-1-git-send-email-wd@denx.de> References: <1224658841-14858-1-git-send-email-wd@denx.de> Message-ID: <20081024113041.GA32425@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > #include > #include > +#include > > static ulong timer_load_val; > > @@ -148,7 +149,9 @@ void reset_timer(void) > > ulong get_timer_masked(void) > { > - return get_ticks() / (timer_load_val / (100 * CFG_HZ)); > + unsigned long long res = get_ticks(); > + do_div (res, (timer_load_val / (100 * CFG_HZ))); > + return res; CFG_HZ was renamed CONFIG_SYS_HZ > } I've start to think to re-rename it CFG_HZ as done in Linux, normaly this value is the same for all arch & board Best Regards, J.