From: Bernardo Innocenti <bernie@develer.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Richard Henderson <rth@twiddle.net>,
Andrea Arcangeli <andrea@suse.de>, Andrew Morton <akpm@digeo.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix do_div() for all architectures
Date: Fri, 11 Jul 2003 01:13:04 +0200 [thread overview]
Message-ID: <200307110113.04982.bernie@develer.com> (raw)
In-Reply-To: <20030710154019.GA18697@twiddle.net>
On Thursday 10 July 2003 17:40, Richard Henderson wrote:
> On Tue, Jul 08, 2003 at 08:27:26PM +0200, Bernardo Innocenti wrote:
> > +extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor)
> > __attribute_pure__;
>
> ...
>
> > + __rem = __div64_32(&(n), __base); \
>
> The pure declaration is very incorrect. You're writing to N.
Here comes the obvious fix. Mea culpa, mea culpa, mea maxima culpa!
NOTE: I've intentionally left the __attribute_pure__ definition in
linux/compiler.h since it might apply to many other functions.
Linus, please apply and forgive me for getting this simple patch wrong
so many times in a row.
-------------------------------------------------------------------------
- remove incorrect __attribute_pure__ from __div64_32() since it obviously
clobbers memory through &(n);
diff -Nru linux-2.5.74-bk4.orig/include/asm-generic/div64.h linux-2.5.74-bk4/include/asm-generic/div64.h
--- linux-2.5.74-bk4.orig/include/asm-generic/div64.h 2003-07-11 01:00:44.000000000 +0200
+++ linux-2.5.74-bk4/include/asm-generic/div64.h 2003-07-11 00:59:52.000000000 +0200
@@ -32,7 +32,7 @@
#elif BITS_PER_LONG == 32
-extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor) __attribute_pure__;
+extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
# define do_div(n,base) ({ \
uint32_t __base = (base); \
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/
Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html
next prev parent reply other threads:[~2003-07-10 22:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-05 23:33 [PATCH] Fix do_div() for all architectures Bernardo Innocenti
2003-07-06 7:47 ` Russell King
2003-07-06 15:40 ` Ian Molton
2003-07-07 4:26 ` Bernardo Innocenti
2003-07-08 18:27 ` Bernardo Innocenti
2003-07-08 18:31 ` Andrew Morton
2003-07-08 20:56 ` Bernardo Innocenti
2003-07-10 15:40 ` Richard Henderson
2003-07-10 16:18 ` Andrea Arcangeli
2003-07-10 16:39 ` Richard Henderson
2003-07-10 19:31 ` Bernardo Innocenti
2003-07-10 19:53 ` Dale Johannesen
2003-07-10 20:19 ` Andrea Arcangeli
2003-07-10 22:58 ` Bernardo Innocenti
2003-07-10 22:04 ` Richard Henderson
2003-07-10 23:13 ` Bernardo Innocenti [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-07-02 16:16 [PATCH] Kill div64.h dupes, parenthesize do_div() macro params Linus Torvalds
2003-07-03 10:43 ` [PATCH] Fix do_div() for all architectures Bernardo Innocenti
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=200307110113.04982.bernie@develer.com \
--to=bernie@develer.com \
--cc=akpm@digeo.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rth@twiddle.net \
--cc=torvalds@osdl.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;
as well as URLs for NNTP newsgroup(s).