* [PATCH] Blackfin: Fix hamming weight functions
@ 2010-08-24 22:02 David Howells
2010-08-24 22:28 ` [Uclinux-dist-devel] " Mike Frysinger
0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2010-08-24 22:02 UTC (permalink / raw)
To: vapier; +Cc: uclinux-dist-devel, linux-kernel
Fix the hamming weight functions to support the const variants in
asm-generic/bitops/const_hweight.h.
To this end, the arch specific hweightN() functions are renamed to
__arch_hweightN() and the generic header file included which will use them as
appropriate.
Without this, I see the following error:
fs/fcntl.c: In function 'fcntl_init':
fs/fcntl.c:773: error: implicit declaration of function 'HWEIGHT32'
fs/fcntl.c:773: error: bit-field '<anonymous>' width not an integer constant
Signed-off-by: David Howells <dhowells@redhat.com>
---
arch/blackfin/include/asm/bitops.h | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index d5872cd..5f259a9 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -115,7 +115,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
* of bits set) of a N-bit word
*/
-static inline unsigned int hweight32(unsigned int w)
+static inline unsigned int __arch_hweight32(unsigned int w)
{
unsigned int res;
@@ -125,19 +125,22 @@ static inline unsigned int hweight32(unsigned int w)
return res;
}
-static inline unsigned int hweight64(__u64 w)
+static inline unsigned int __arch_hweight64(__u64 w)
{
- return hweight32((unsigned int)(w >> 32)) + hweight32((unsigned int)w);
+ return __arch_hweight32((unsigned int)(w >> 32)) +
+ __arch_hweight32((unsigned int)w);
}
-static inline unsigned int hweight16(unsigned int w)
+static inline unsigned int __arch_hweight16(unsigned int w)
{
- return hweight32(w & 0xffff);
+ return __arch_hweight32(w & 0xffff);
}
-static inline unsigned int hweight8(unsigned int w)
+static inline unsigned int __arch_hweight8(unsigned int w)
{
- return hweight32(w & 0xff);
+ return __arch_hweight32(w & 0xff);
}
+#include <asm-generic/bitops/const_hweight.h>
+
#endif /* _BLACKFIN_BITOPS_H */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Uclinux-dist-devel] [PATCH] Blackfin: Fix hamming weight functions
2010-08-24 22:02 [PATCH] Blackfin: Fix hamming weight functions David Howells
@ 2010-08-24 22:28 ` Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2010-08-24 22:28 UTC (permalink / raw)
To: David Howells; +Cc: uclinux-dist-devel, linux-kernel
On Tue, Aug 24, 2010 at 18:02, David Howells wrote:
> Fix the hamming weight functions to support the const variants in
> asm-generic/bitops/const_hweight.h.
mmm i sent a pull request to Linus for this already ... you can find
the same fix in my for-linus branch
http://git.kernel.org/?p=linux/kernel/git/vapier/blackfin.git;a=shortlog;h=refs/heads/for-linus
-mike
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-24 22:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-24 22:02 [PATCH] Blackfin: Fix hamming weight functions David Howells
2010-08-24 22:28 ` [Uclinux-dist-devel] " Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®