Skip to content

Commit

Permalink
[PATCH] oss/sonicvibes.c defines its own hweight32
Browse files Browse the repository at this point in the history
sound/oss/sonicvibes.c:421: error: static declaration of hweight32 follows non-static declaration
include/asm-generic/bitops/hweight.h:6: error: previous declaration of hweight32 was here

Signed-off-by: Richard Knutsson <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Richard Knutsson authored and Linus Torvalds committed Mar 26, 2006
1 parent 9363513 commit 2054866
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions sound/oss/sonicvibes.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,24 +407,6 @@ static inline unsigned ld2(unsigned int x)
return r;
}

/*
* hweightN: returns the hamming weight (i.e. the number
* of bits set) of a N-bit word
*/

#ifdef hweight32
#undef hweight32
#endif

static inline unsigned int hweight32(unsigned int w)
{
unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F);
res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF);
return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF);
}

/* --------------------------------------------------------------------- */

/*
Expand Down

0 comments on commit 2054866

Please sign in to comment.