Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752735AbbFEVM3 (ORCPT ); Fri, 5 Jun 2015 17:12:29 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:51110 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752599AbbFEVM1 (ORCPT ); Fri, 5 Jun 2015 17:12:27 -0400 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: Tina Ruchandani , Dave Airlie , Linux Fbdev development list , Benjamin Herrenschmidt , LKML , Tomi Valkeinen , Jean-Christophe Plagniol-Villard Subject: Re: [Y2038] [PATCH] fbdev: radeon: Remove 'struct timeval' usage Date: Fri, 05 Jun 2015 23:12:14 +0200 Message-ID: <119465383.9W9klrlRVh@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:27P9c1QBGLQGliudmWsZIzpWLxuFTIuHq0pMsuUe73woFOu0fIN LMjzd5nZT/wzPRkqCzMbZ/fWq0mlY66/jxvbG5pSqSjLPxCdwJxr+W+ytqYHNX1+orvq/G+ y3HAvb9c3ZX7mX+yZ9TfW7/xiuRzidNPeDQL/KOCL5ebnhU18gszX+TQJ4O8jxKFIF+u00E OLguRgb99M0WUBULeNIXQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:iUoFWWEM5gE=:zXF9ZI2gjyArPC4rFEr+Xo Himz5bz/vndZXumFXcmKKbu9yD9zsw1EC8ru27RbrdzeWohpYv8QBo5kaK3GCnSpCOn+a0ZIU fWcg5cJ4m9q08e46j7Pu7gK6YCy3Em12JBXRiV0AdIpTFpgBkdZXgomvItxghpPDPqOdA0vev Nc9+qiQqRRgY+Ko/iDmJCoRDUcnrKaZUIZK9b+VHEsgrNDLv5L3kCl83M2rxGzXo7K1X4Y5qQ KhNYqUWBLmVJOE8mrZyYTW6AeHg7oANo94sx9JiTUAZTqKCpa99ENc7Y/x1rWDYlJSKVGR8W3 ip145/ggN0vtXrwxx1XHKATo98zbuY53bWgfr4uUArbvzOAw7alerjB0qygk76GxSxkpiPB2B TMnSdI11g2O4g8H5iHHCOIx7Qzc72dndGk4X8FRgrMY0yQdcqLA5CyroTxBTYyNU6O40HoKNO zS5sEMU+S2/9bQp9Tob9yk6/GcGpz5BvsogvtJqXjkl3dQ4zx0/MDzaSRRkEBJWgwQRii9l6U ShzLHlyfrfKriaEzc0l7W1nlQrjM3PnWvtdE+5WEeahKcSGk4885P8OroyLM200Zoj2Mfu8/H hdUe9FgNQlaJcPiVJblbEQOSB25CsUgTYpTNeQKA1b+8sRY6ajEOFFf0e+oCNOrYir71HawAu 3z6vodBS1WAfZjwLfvCFKdd2Sf76yJ9FizA1NlK/5FEBzmw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1010 Lines: 28 On Friday 05 June 2015 00:55:05 Tina Ruchandani wrote: > >>> + hz = 1000000/delta; > > > > This needs to be on of the do_div family. > > > > Dave. > > Hi Dave, > I build-tested the patch for both 32-bit and 64-bit x86. If my > understanding is correct, since the divisor is 64-bit here, the > compiler will do "if (delta > 1000000) hz = 0; else hz = > 1000000/(s32)delta" automatically? > In general, is this a good thumb-rule to follow - use do_div if the > dividend is 64-bit, and normal divide operator if only the divisor is > 64-bit? > I got a build error on 32-bit arm now. There is already a check for an overflow of 10 seconds in there (10 million microseconds), so it is safe to do the easiest fix is to cast that microsecond value to a u32. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/