From: Arnd Bergmann <arnd@arndb.de>
To: y2038@lists.linaro.org
Cc: Tina Ruchandani <ruchandani.tina@gmail.com>,
Dave Airlie <airlied@gmail.com>,
Linux Fbdev development list <linux-fbdev@vger.kernel.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
LKML <linux-kernel@vger.kernel.org>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Subject: Re: [Y2038] [PATCH] fbdev: radeon: Remove 'struct timeval' usage
Date: Fri, 05 Jun 2015 21:12:14 +0000 [thread overview]
Message-ID: <119465383.9W9klrlRVh@wuerfel> (raw)
In-Reply-To: <CAB__kknUjU1vdERZQQCxD95idobKN6M-eQZP1jH77tTS3MxhGA@mail.gmail.com>
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
next prev parent reply other threads:[~2015-06-05 21:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-25 4:19 [PATCH] fbdev: radeon: Remove 'struct timeval' usage Tina Ruchandani
2015-06-03 11:59 ` Tomi Valkeinen
2015-06-05 4:40 ` Dave Airlie
2015-06-05 7:55 ` Tina Ruchandani
2015-06-05 21:12 ` Arnd Bergmann [this message]
2015-08-20 7:51 ` Tomi Valkeinen
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=119465383.9W9klrlRVh@wuerfel \
--to=arnd@arndb.de \
--cc=airlied@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=ruchandani.tina@gmail.com \
--cc=tomi.valkeinen@ti.com \
--cc=y2038@lists.linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox