From: Pavel Machek <pavel@ucw.cz>
To: "Amit S. Kale" <akale@users.sourceforge.net>,
kernel list <linux-kernel@vger.kernel.org>
Subject: hweight64
Date: Tue, 17 Feb 2004 11:34:51 +0100 [thread overview]
Message-ID: <20040217103451.GA440@elf.ucw.cz> (raw)
Hi!
In kgdb patches you change prototype of hweight64. Why that change?
[This patch is reverse]
I do not see what it has to do with kgdb. Its true that result always
fits into int, but I'd be afraid of small sideeffects somewhere...
Pavel
--- clean-mm/include/linux/bitops.h 2004-02-16 23:00:15.000000000 +0100
+++ linux-mm/include/linux/bitops.h 2003-06-24 12:28:05.000000000 +0200
@@ -108,7 +108,7 @@
return (res & 0x0F) + ((res >> 4) & 0x0F);
}
-static inline unsigned int generic_hweight64(__u64 w)
+static inline unsigned long generic_hweight64(__u64 w)
{
#if BITS_PER_LONG < 64
return generic_hweight32((unsigned int)(w >> 32)) +
@@ -120,8 +120,7 @@
res = (res & 0x0F0F0F0F0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F0F0F0F0F);
res = (res & 0x00FF00FF00FF00FF) + ((res >> 8) & 0x00FF00FF00FF00FF);
res = (res & 0x0000FFFF0000FFFF) + ((res >> 16) & 0x0000FFFF0000FFFF);
- res = (res & 0x00000000FFFFFFFF) + ((res >> 32) & 0x00000000FFFFFFFF);
- return (unsigned int)res;
+ return (res & 0x00000000FFFFFFFF) + ((res >> 32) & 0x00000000FFFFFFFF);
#endif
}
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
next reply other threads:[~2004-02-17 10:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-17 10:34 Pavel Machek [this message]
2004-02-17 11:25 ` hweight64 Amit S. Kale
2004-02-18 1:39 ` hweight64 Andi Kleen
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=20040217103451.GA440@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akale@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.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