From: York Sun Date: Mon, 14 Mar 2011 13:22:22 -0700 Subject: [U-Boot] [PATCHv2] fsl_ddr: Don't use full 64-bit divides on 32-bit PowerPC In-Reply-To: <1298478920-22044-1-git-send-email-Kyle.D.Moffett@boeing.com> References: <1298478920-22044-1-git-send-email-Kyle.D.Moffett@boeing.com> Message-ID: <1300134142.23720.52.camel@oslab-l1> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2011-02-23 at 11:35 -0500, Kyle Moffett wrote: > + * Now divide by 5^12 and track the 32-bit remainder, then divide > + * by 2*(2^12) using shifts (and updating the remainder). > + */ > + clks_rem = do_div(clks, UL_5pow12); > + clks_rem <<= 13; Shouldn't this be clks_rem >>= 13 ? > + clks_rem |= clks & (UL_2pow13-1); > + clks >>= 13; > + > + /* If we had a remainder, then round up */ > + if (clks_rem) > clks++; > - } York