Skip to content
Commit 2248ccd8 authored by Sander Vanheule's avatar Sander Vanheule Committed by Yury Norov
Browse files

lib/cpumask: add inline cpumask_next_wrap() for UP



In the uniprocessor case, cpumask_next_wrap() can be simplified, as the
number of valid argument combinations is limited:
    - 'start' can only be 0
    - 'n' can only be -1 or 0

The only valid CPU that can then be returned, if any, will be the first
one set in the provided 'mask'.

For NR_CPUS == 1, include/linux/cpumask.h now provides an inline
definition of cpumask_next_wrap(), which will conflict with the one
provided by lib/cpumask.c.  Make building of lib/cpumask.o again depend
on CONFIG_SMP=y (i.e. NR_CPUS > 1) to avoid the re-definition.

Suggested-by: default avatarYury Norov <yury.norov@gmail.com>
Signed-off-by: default avatarSander Vanheule <sander@svanheule.net>
Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
parent be599244
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment