Re: [PATCH] Fix CPU bitmask truncation

William Lee Irwin III (wli@holomorphy.com)
Fri, 20 Dec 2002 09:12:43 -0800


William Lee Irwin III <wli@holomorphy.com> writes:
|> ===== include/linux/init_task.h 1.19 vs edited =====
|> --- 1.19/include/linux/init_task.h Sun Sep 29 07:02:55 2002
|> +++ edited/include/linux/init_task.h Fri Dec 20 02:22:04 2002
|> @@ -63,7 +63,7 @@
|> .prio = MAX_PRIO-20, \
|> .static_prio = MAX_PRIO-20, \
|> .policy = SCHED_NORMAL, \
|> - .cpus_allowed = -1, \
|> + .cpus_allowed = ~0UL, \

On Fri, Dec 20, 2002 at 01:17:24PM +0100, Andreas Schwab wrote:
> This is useless. Assigning -1 to any unsigned type is garanteed to give
> you all bits one, and with two's complement this also holds for any signed
> type.

Not so on all gcc versions. The rest of the world can figure out what
to do about the versions that do not.

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