Skip to content

Commit

Permalink
dyn_array: don't break compiling for !CONFIG_SMP
Browse files Browse the repository at this point in the history
Impact: build failure on uniprocessor

When compiling for !CONFIG_SMP, per_cpu_alloc_dyn_array() would fail
to compile, since it uses per_cpu_offset, which is not defined for
uniprocessor builds.

Hence, do not compile per_cpu_alloc_dyn_array() for !CONFIG_SMP.
Attempting to call this function in a uniprocessor configuration would
be simply wrong in the first place.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
H. Peter Anvin authored and Ingo Molnar committed Oct 16, 2008
1 parent 1c7d1bc commit e8fc96e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions init/dyn_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ unsigned long __init per_cpu_dyn_array_size(unsigned long *align)
return total_size;
}

#ifdef CONFIG_SMP
void __init per_cpu_alloc_dyn_array(int cpu, char *ptr)
{
#ifdef CONFIG_HAVE_DYN_ARRAY
Expand Down Expand Up @@ -122,3 +123,4 @@ void __init per_cpu_alloc_dyn_array(int cpu, char *ptr)
}
#endif
}
#endif

0 comments on commit e8fc96e

Please sign in to comment.