[PATCH 4/4] x86: conditionally compile sysfs stuff in intel_cacheinfo.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitri Vorobiev
Date: Saturday, April 19, 2008 - 7:54 pm

Four functions defined in arch/x86/kernel/cpu/intel_cacheinfo.c:

cache_shared_cpu_map_setup()
cache_remove_shared_cpu_map()
free_cache_attributes()
detect_cache_attributes()

are needed only in the code that is conditionally compiled when
CONFIG_SYSFS is defined. The same is true about the cpuid4_info[]
array. This patch places the definitions of these functions and
the array inside the corresponding ifdef.

This patch was build-tested both with sysfs turned off and on.
The kernel was built successfully in both cases. Runtime tests
were performed using x86 and x86_64 machines, which booted to
the shell prompt successfully.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/x86/kernel/cpu/intel_cacheinfo.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 1b88986..d743dfe 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -450,6 +450,8 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
 	return l2;
 }
 
+#ifdef CONFIG_SYSFS
+
 /* pointer to _cpuid4_info array (for each cache leaf) */
 static struct _cpuid4_info *cpuid4_info[NR_CPUS];
 #define CPUID4_INFO_IDX(x,y)    (&((cpuid4_info[x])[y]))
@@ -553,8 +555,6 @@ out:
 	return retval;
 }
 
-#ifdef CONFIG_SYSFS
-
 #include <linux/kobject.h>
 #include <linux/sysfs.h>
 
-- 
1.5.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/4] x86: random clean-ups, Dmitri Vorobiev, (Sat Apr 19, 7:54 pm)
[PATCH 1/4] x86: remove unused function amd_init_cpu(), Dmitri Vorobiev, (Sat Apr 19, 7:54 pm)
[PATCH 2/4] x86: remove unused code and data in nexgen.c, Dmitri Vorobiev, (Sat Apr 19, 7:54 pm)
[PATCH 4/4] x86: conditionally compile sysfs stuff in inte ..., Dmitri Vorobiev, (Sat Apr 19, 7:54 pm)
Re: [PATCH 2/4] x86: remove unused code and data in nexgen.c, Dmitri Vorobiev, (Sun Apr 20, 12:24 pm)
Re: [PATCH 2/4] x86: remove unused code and data in nexgen.c, H. Peter Anvin, (Sun Apr 20, 12:34 pm)
Re: [PATCH 2/4] x86: remove unused code and data in nexgen.c, Dmitri Vorobiev, (Sun Apr 20, 12:45 pm)
Re: [PATCH 2/4] x86: remove unused code and data in nexgen.c, H. Peter Anvin, (Sun Apr 20, 12:47 pm)
Re: [PATCH 0/4] x86: random clean-ups, Ingo Molnar, (Mon Apr 21, 5:25 am)
Re: [PATCH 2/4] x86: remove unused code and data in nexgen.c, Dmitri Vorobiev, (Wed Apr 23, 12:02 pm)