diff options
author | Yury Norov <yury.norov@gmail.com> | 2022-07-01 05:54:27 -0700 |
---|---|---|
committer | Yury Norov <yury.norov@gmail.com> | 2022-07-15 06:35:54 -0700 |
commit | 8b6b795d9bfc031a8953c40fac8d3cf67e1a4d3d (patch) | |
tree | 8a4614fcc0a10d1493893cd6df5ba632d9382cb6 /lib/cpumask.c | |
parent | cb32c285cc10e428589194e30233d673e7c23c72 (diff) | |
download | linux-stable-8b6b795d9bfc031a8953c40fac8d3cf67e1a4d3d.tar.gz linux-stable-8b6b795d9bfc031a8953c40fac8d3cf67e1a4d3d.tar.bz2 linux-stable-8b6b795d9bfc031a8953c40fac8d3cf67e1a4d3d.zip |
lib/cpumask: change return types to unsigned where appropriate
Switch return types to unsigned int where return values cannot be negative.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
Diffstat (limited to 'lib/cpumask.c')
-rw-r--r-- | lib/cpumask.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/cpumask.c b/lib/cpumask.c index a971a82d2f43..da68f6bbde44 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -31,7 +31,7 @@ EXPORT_SYMBOL(cpumask_next); * * Returns >= nr_cpu_ids if no further cpus set in both. */ -int cpumask_next_and(int n, const struct cpumask *src1p, +unsigned int cpumask_next_and(int n, const struct cpumask *src1p, const struct cpumask *src2p) { /* -1 is a legal arg here. */ @@ -50,7 +50,7 @@ EXPORT_SYMBOL(cpumask_next_and); * Often used to find any cpu but smp_processor_id() in a mask. * Returns >= nr_cpu_ids if no cpus set. */ -int cpumask_any_but(const struct cpumask *mask, unsigned int cpu) +unsigned int cpumask_any_but(const struct cpumask *mask, unsigned int cpu) { unsigned int i; @@ -74,9 +74,9 @@ EXPORT_SYMBOL(cpumask_any_but); * Note: the @wrap argument is required for the start condition when * we cannot assume @start is set in @mask. */ -int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap) +unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap) { - int next; + unsigned int next; again: next = cpumask_next(n, mask); @@ -205,7 +205,7 @@ void __init free_bootmem_cpumask_var(cpumask_var_t mask) */ unsigned int cpumask_local_spread(unsigned int i, int node) { - int cpu; + unsigned int cpu; /* Wrap: we always want a cpu. */ i %= num_online_cpus(); @@ -243,10 +243,10 @@ static DEFINE_PER_CPU(int, distribute_cpu_mask_prev); * * Returns >= nr_cpu_ids if the intersection is empty. */ -int cpumask_any_and_distribute(const struct cpumask *src1p, +unsigned int cpumask_any_and_distribute(const struct cpumask *src1p, const struct cpumask *src2p) { - int next, prev; + unsigned int next, prev; /* NOTE: our first selection will skip 0. */ prev = __this_cpu_read(distribute_cpu_mask_prev); @@ -262,9 +262,9 @@ int cpumask_any_and_distribute(const struct cpumask *src1p, } EXPORT_SYMBOL(cpumask_any_and_distribute); -int cpumask_any_distribute(const struct cpumask *srcp) +unsigned int cpumask_any_distribute(const struct cpumask *srcp) { - int next, prev; + unsigned int next, prev; /* NOTE: our first selection will skip 0. */ prev = __this_cpu_read(distribute_cpu_mask_prev); |