소스 검색

dyn_array: don't break compiling for !CONFIG_SMP

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>
H. Peter Anvin 17 년 전
부모
커밋
e8fc96ed36
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      init/dyn_array.c

+ 2 - 0
init/dyn_array.c

@@ -91,6 +91,7 @@ unsigned long __init per_cpu_dyn_array_size(unsigned long *align)
 	return total_size;
 	return total_size;
 }
 }
 
 
+#ifdef CONFIG_SMP
 void __init per_cpu_alloc_dyn_array(int cpu, char *ptr)
 void __init per_cpu_alloc_dyn_array(int cpu, char *ptr)
 {
 {
 #ifdef CONFIG_HAVE_DYN_ARRAY
 #ifdef CONFIG_HAVE_DYN_ARRAY
@@ -122,3 +123,4 @@ void __init per_cpu_alloc_dyn_array(int cpu, char *ptr)
 	}
 	}
 #endif
 #endif
 }
 }
+#endif