From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pv0-f170.google.com (mail-pv0-f170.google.com [74.125.83.170]) by ozlabs.org (Postfix) with ESMTP id 9FCEDB7D1C for ; Sat, 1 May 2010 04:19:17 +1000 (EST) Received: by pvh11 with SMTP id 11so19367pvh.15 for ; Fri, 30 Apr 2010 11:19:16 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20100430162254.GA24285@schlenkerla.am.freescale.net> References: <1272584978-19063-1-git-send-email-agust@denx.de> <1272584978-19063-4-git-send-email-agust@denx.de> <20100430121947.1d265ca6@wker> <20100430162254.GA24285@schlenkerla.am.freescale.net> From: Timur Tabi Date: Fri, 30 Apr 2010 13:18:46 -0500 Message-ID: Subject: Re: [PATCH 3/5] powerpc/mpc5121: shared DIU framebuffer support To: Scott Wood Content-Type: text/plain; charset=ISO-8859-1 Cc: linux-fbdev@vger.kernel.org, wd@denx.de, dzu@denx.de, John Rigby , devicetree-discuss@lists.ozlabs.org, linuxppc-dev@ozlabs.org, Anatolij Gustschin , yorksun@freescale.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, Apr 30, 2010 at 11:22 AM, Scott Wood wrot= e: >> That's what I meant. =A0Actually, I think it's ULL. =A0Regardless, I thi= nk >> the compiler will see the =A0"1000000000 ... * 1000" and just combine >> them together. =A0You're not actually outsmarting the compiler. > > The compiler will do no such thing. =A0That's a valid transformation when > doing pure math, but not when working with integers. I ran some tests, and it appears you're right. I doesn't make a lot of sense to me, but whatever. However, "(1000000000 / pixclock) * 1000" produces a result that's less accurate than "1000000000000ULL / pixclock". Unfortunately, that math caused a linker problem with __udivdi3 when I tried it, so maybe you can use do_div() instead? >> =A0 =A0 err =3D -1; >> >> because he wanted it to be the largest possible integer. > > -1 is not the largest possible integer. =A0LONG_MAX, perhaps? What, you don't like implicit casting of -1 to an unsigned? :-) Since err is a long integer, LONG_MAX is the better choice. --=20 Timur Tabi Linux kernel developer at Freescale