Re: [PATCH][2.6] first/next_cpu returns values > NR_CPUS

From: William Lee Irwin III
Date: Thu Aug 05 2004 - 12:22:15 EST


Matthew Dobson <colpatch@xxxxxxxxxx> writes:
>> #define next_node(n, src) __next_node((n), &(src), MAX_NUMNODES)
>> static inline int __next_node(int n, const nodemask_t *srcp, int nbits)
>> {
>> - return find_next_bit(srcp->bits, nbits, n+1);
>> + return min_t(int, nbits, find_next_bit(srcp->bits, nbits, n+1));
>> }

On Fri, Aug 06, 2004 at 01:50:23AM +0900, OGAWA Hirofumi wrote:
> Shouldn't these use simply min()? I worry min_t() may hide the real bug...

min_t() is harmless here. Some 64-bit architectures use long as the
return type of find_next_bit(), but its precision isn't needed, so
min_t() merely prevents up a useless warning.


-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/