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

From: William Lee Irwin III
Date: Sun Aug 01 2004 - 10:11:28 EST


On Sun, 1 Aug 2004, William Lee Irwin III wrote:
>> Maybe the few callers that are sensitive to the precise return value
>> should use min_t(int, NR_CPUS, ...) instead of all callers taking the
>> branch on behalf of those few.

On Sun, Aug 01, 2004 at 10:54:03AM -0400, Zwane Mwaikambo wrote:
> The problem is that next_cpu(0) will assign the incorrect value of '32'
> to variable cpu so when you exit the loop, you'll have some silly number.
> This really should be covered in the API, especially since that's what the
> API states is the expected behaviour.

I see. AFAICT this can also be dealt with by the caller and is far less
common than total insensitivity to which value >= NR_CPUS is involved.


-- 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/