Skip to contentSkip to conversation

PPC64 sparse fixes for cpu feature constants

PATCH New Paul Mackerras 1 participant 1 message Jan 22, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PPC64 sparse fixes for cpu feature constants

This patch is originally from Nathan Lynch <[email protected]>.

Sparse gives a warning "constant ... is so big it is long" for every expression where we check bits in the cur_cpu_spec->cpu_features value. This patch removes the warnings by using the ASM_CONST macro.

include/asm-ppc64/cacheflush.h +1 -1
diff -urN linux-2.5/include/asm-ppc64/cacheflush.h test/include/asm-ppc64/cacheflush.h
@@ -40,7 +40,7 @@
 
 static inline void flush_icache_range(unsigned long start, unsigned long stop)
 {
-	if (!(cur_cpu_spec->cpu_features & ASM_CONST(CPU_FTR_COHERENT_ICACHE)))
+	if (!(cur_cpu_spec->cpu_features & CPU_FTR_COHERENT_ICACHE))
 		__flush_icache_range(start, stop);
 }
 
include/asm-ppc64/cputable.h +29 -28

73 lines not on this page · raw message

include/asm-ppc64/mmu_context.h +5 -8
diff -urN linux-2.5/include/asm-ppc64/mmu_context.h test/include/asm-ppc64/mmu_context.h
@@ -51,14 +51,6 @@
 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 			     struct task_struct *tsk)
 {
-#ifdef CONFIG_ALTIVEC
-	asm volatile (
- BEGIN_FTR_SECTION
-	"dssall;\n"
- END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
-	 : : );
-#endif /* CONFIG_ALTIVEC */
-
 	if (!cpu_isset(smp_processor_id(), next->cpu_vm_mask))
 		cpu_set(smp_processor_id(), next->cpu_vm_mask);
 
@@ -66,6 +58,11 @@
 	if (prev == next)
 		return;
 
+#ifdef CONFIG_ALTIVEC
+	if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
+		asm volatile ("dssall");
+#endif /* CONFIG_ALTIVEC */
+
 	if (cur_cpu_spec->cpu_features & CPU_FTR_SLB)
 		switch_slb(tsk, next);
 	else