* [KJ] [Patch] Fix warnings in intel_cacheinfo.c
@ 2005-12-08 1:27 Eric Sesterhenn / snakebyte
2005-12-14 15:59 ` Alexey Dobriyan
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sesterhenn / snakebyte @ 2005-12-08 1:27 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]
This patch fixes two compiler warnings in intel_cacheinfo.c when sysfs is not defined.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
---
I hope the patch arrives unmangled and the format and the patch itself are ok.
Thanks for reviewing/forwarding.
Eric
--- linux-2.6.15-rc5/arch/i386/kernel/cpu/intel_cacheinfo.c.orig 2005-12-08 01:21:58.000000000 +0100
+++ linux-2.6.15-rc5/arch/i386/kernel/cpu/intel_cacheinfo.c 2005-12-08 01:20:33.000000000 +0100
@@ -287,10 +287,13 @@ unsigned int __cpuinit init_intel_cachei
}
/* pointer to _cpuid4_info array (for each cache leaf) */
+#ifdef CONFIG_SYSFS
static struct _cpuid4_info *cpuid4_info[NR_CPUS];
#define CPUID4_INFO_IDX(x,y) (&((cpuid4_info[x])[y]))
+#endif
#ifdef CONFIG_SMP
+#ifdef CONFIG_SYSFS
static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
{
struct _cpuid4_info *this_leaf, *sibling_leaf;
@@ -329,11 +332,13 @@ static void __devinit cache_remove_share
cpu_clear(cpu, sibling_leaf->shared_cpu_map);
}
}
+#endif
#else
static void __init cache_shared_cpu_map_setup(unsigned int cpu, int index) {}
static void __init cache_remove_shared_cpu_map(unsigned int cpu, int index) {}
#endif
+#ifdef CONFIG_SYSFS
static void free_cache_attributes(unsigned int cpu)
{
kfree(cpuid4_info[cpu]);
@@ -378,6 +383,7 @@ out:
free_cache_attributes(cpu);
return retval;
}
+#endif
#ifdef CONFIG_SYSFS
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [KJ] [Patch] Fix warnings in intel_cacheinfo.c
2005-12-08 1:27 [KJ] [Patch] Fix warnings in intel_cacheinfo.c Eric Sesterhenn / snakebyte
@ 2005-12-14 15:59 ` Alexey Dobriyan
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2005-12-14 15:59 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 2172 bytes --]
On Thu, Dec 08, 2005 at 02:27:53AM +0100, Eric Sesterhenn / snakebyte wrote:
> This patch fixes two compiler warnings in intel_cacheinfo.c when sysfs is not defined.
I think I have a cleaner fix.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
arch/i386/kernel/cpu/intel_cacheinfo.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -286,6 +286,11 @@ unsigned int __cpuinit init_intel_cachei
return l2;
}
+#ifdef CONFIG_SYSFS
+
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+
/* 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]))
@@ -379,11 +384,6 @@ out:
return retval;
}
-#ifdef CONFIG_SYSFS
-
-#include <linux/kobject.h>
-#include <linux/sysfs.h>
-
extern struct sysdev_class cpu_sysdev_class; /* from drivers/base/cpu.c */
/* pointer to kobject for cpuX/cache */
> --- linux-2.6.15-rc5/arch/i386/kernel/cpu/intel_cacheinfo.c.orig
> +++ linux-2.6.15-rc5/arch/i386/kernel/cpu/intel_cacheinfo.c
> @@ -287,10 +287,13 @@ unsigned int __cpuinit init_intel_cachei
> }
>
> /* pointer to _cpuid4_info array (for each cache leaf) */
> +#ifdef CONFIG_SYSFS
> static struct _cpuid4_info *cpuid4_info[NR_CPUS];
> #define CPUID4_INFO_IDX(x,y) (&((cpuid4_info[x])[y]))
> +#endif
>
> #ifdef CONFIG_SMP
> +#ifdef CONFIG_SYSFS
> static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
> {
> struct _cpuid4_info *this_leaf, *sibling_leaf;
> @@ -329,11 +332,13 @@ static void __devinit cache_remove_share
> cpu_clear(cpu, sibling_leaf->shared_cpu_map);
> }
> }
> +#endif
> #else
> static void __init cache_shared_cpu_map_setup(unsigned int cpu, int index) {}
> static void __init cache_remove_shared_cpu_map(unsigned int cpu, int index) {}
> #endif
>
> +#ifdef CONFIG_SYSFS
> static void free_cache_attributes(unsigned int cpu)
> {
> kfree(cpuid4_info[cpu]);
> @@ -378,6 +383,7 @@ out:
> free_cache_attributes(cpu);
> return retval;
> }
> +#endif
>
> #ifdef CONFIG_SYSFS
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-12-14 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-08 1:27 [KJ] [Patch] Fix warnings in intel_cacheinfo.c Eric Sesterhenn / snakebyte
2005-12-14 15:59 ` Alexey Dobriyan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.