aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-03-23 10:37:02 -0400
committerMichal Simek <monstr@monstr.eu>2010-04-01 02:38:24 -0400
commit78ebfa884bcef125464399f8d1cb05937bfeb6e1 (patch)
tree594faeddafb18ab0deca09ef5cc119d21aee4e0e /arch/microblaze/kernel
parent13851966da54be8e37863aa93ee2c8f3d3a3186a (diff)
microblaze: Adding likely macros
On the base on GCOV analytics is helpful to add likely/unlikely macros. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel')
-rw-r--r--arch/microblaze/kernel/dma.c2
-rw-r--r--arch/microblaze/kernel/process.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c
index b1084974fccd..4d5b0311601b 100644
--- a/arch/microblaze/kernel/dma.c
+++ b/arch/microblaze/kernel/dma.c
@@ -37,7 +37,7 @@ static inline void __dma_sync_page(unsigned long paddr, unsigned long offset,
37 37
38static unsigned long get_dma_direct_offset(struct device *dev) 38static unsigned long get_dma_direct_offset(struct device *dev)
39{ 39{
40 if (dev) 40 if (likely(dev))
41 return (unsigned long)dev->archdata.dma_data; 41 return (unsigned long)dev->archdata.dma_data;
42 42
43 return PCI_DRAM_OFFSET; /* FIXME Not sure if is correct */ 43 return PCI_DRAM_OFFSET; /* FIXME Not sure if is correct */
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index 35efb2f42d50..09bed44dfcd3 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -75,7 +75,10 @@ __setup("hlt", hlt_setup);
75 75
76void default_idle(void) 76void default_idle(void)
77{ 77{
78 if (!hlt_counter) { 78 if (likely(hlt_counter)) {
79 while (!need_resched())
80 cpu_relax();
81 } else {
79 clear_thread_flag(TIF_POLLING_NRFLAG); 82 clear_thread_flag(TIF_POLLING_NRFLAG);
80 smp_mb__after_clear_bit(); 83 smp_mb__after_clear_bit();
81 local_irq_disable(); 84 local_irq_disable();
@@ -83,9 +86,7 @@ void default_idle(void)
83 cpu_sleep(); 86 cpu_sleep();
84 local_irq_enable(); 87 local_irq_enable();
85 set_thread_flag(TIF_POLLING_NRFLAG); 88 set_thread_flag(TIF_POLLING_NRFLAG);
86 } else 89 }
87 while (!need_resched())
88 cpu_relax();
89} 90}
90 91
91void cpu_idle(void) 92void cpu_idle(void)