lkml.org 
[lkml]   [2008]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] x86: conditionally compile sysfs stuff in intel_cacheinfo.c
Date
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


\
 
 \ /
  Last update: 2008-04-20 04:59    [W:0.254 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site