lkml.org 
[lkml]   [2003]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] Re: Bug 619 - sched_best_cpu does not pick best cpu (2/2)
From
Date
On Mon, 2003-05-05 at 18:28, Matthew Dobson wrote:
> +#if (BITS_PER_LONG == 64)
> +
> +static inline unsigned int generic_hweight64(unsigned int w)
> +{
> + unsigned int res = (w & 0x5555555555555555) + ((w >> 1) & 0x5555555555555555);

First, there is no way this works. unsigned int doesn't
hold 64-bit values on any platform I know of. :-)

The best fix is to use 'u64' here and also to remove the silly
BITS_PER_LONG ifdef, it should always be available even on 32-bit
platforms.

--
David S. Miller <davem@redhat.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.047 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site