Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Code clean-ups for the GIC.

Fix whitespace, beautify the code and remove debug statements.

Signed-off-by: Steven J. Hill <sjhill@mips.com>

+26 -34
+10 -10
arch/mips/include/asm/gic.h
··· 33 33 REG32(_gic_base + segment##_##SECTION_OFS + offset) 34 34 35 35 #define GIC_ABS_REG(segment, offset) \ 36 - (_gic_base + segment##_##SECTION_OFS + offset##_##OFS) 36 + (_gic_base + segment##_##SECTION_OFS + offset##_##OFS) 37 37 #define GIC_REG_ABS_ADDR(segment, offset) \ 38 - (_gic_base + segment##_##SECTION_OFS + offset) 38 + (_gic_base + segment##_##SECTION_OFS + offset) 39 39 40 40 #ifdef GICISBYTELITTLEENDIAN 41 - #define GICREAD(reg, data) (data) = (reg), (data) = le32_to_cpu(data) 42 - #define GICWRITE(reg, data) (reg) = cpu_to_le32(data) 41 + #define GICREAD(reg, data) ((data) = (reg), (data) = le32_to_cpu(data)) 42 + #define GICWRITE(reg, data) ((reg) = cpu_to_le32(data)) 43 43 #define GICBIS(reg, bits) \ 44 44 ({unsigned int data; \ 45 45 GICREAD(reg, data); \ ··· 48 48 }) 49 49 50 50 #else 51 - #define GICREAD(reg, data) (data) = (reg) 52 - #define GICWRITE(reg, data) (reg) = (data) 53 - #define GICBIS(reg, bits) (reg) |= (bits) 51 + #define GICREAD(reg, data) ((data) = (reg)) 52 + #define GICWRITE(reg, data) ((reg) = (data)) 53 + #define GICBIS(reg, bits) ((reg) |= (bits)) 54 54 #endif 55 55 56 56 ··· 304 304 GIC_SH_MAP_TO_VPE_REG_BIT(vpe)) 305 305 306 306 struct gic_pcpu_mask { 307 - DECLARE_BITMAP(pcpu_mask, GIC_NUM_INTRS); 307 + DECLARE_BITMAP(pcpu_mask, GIC_NUM_INTRS); 308 308 }; 309 309 310 310 struct gic_pending_regs { 311 - DECLARE_BITMAP(pending, GIC_NUM_INTRS); 311 + DECLARE_BITMAP(pending, GIC_NUM_INTRS); 312 312 }; 313 313 314 314 struct gic_intrmask_regs { 315 - DECLARE_BITMAP(intrmask, GIC_NUM_INTRS); 315 + DECLARE_BITMAP(intrmask, GIC_NUM_INTRS); 316 316 }; 317 317 318 318 /*
+16 -24
arch/mips/kernel/irq-gic.c
··· 1 - #undef DEBUG 2 - 1 + /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 6 + * Copyright (C) 2008 Ralf Baechle (ralf@linux-mips.org) 7 + * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. 8 + */ 3 9 #include <linux/bitmap.h> 4 10 #include <linux/init.h> 5 11 #include <linux/smp.h> ··· 17 11 #include <linux/hardirq.h> 18 12 #include <asm-generic/bitops/find.h> 19 13 20 - 21 14 unsigned long _gic_base; 22 15 unsigned int gic_irq_base; 23 16 unsigned int gic_irq_flags[GIC_NUM_INTRS]; ··· 27 22 28 23 void gic_send_ipi(unsigned int intr) 29 24 { 30 - pr_debug("CPU%d: %s status %08x\n", smp_processor_id(), __func__, 31 - read_c0_status()); 32 25 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), 0x80000000 | intr); 33 26 } 34 27 35 - /* This is Malta specific and needs to be exported */ 36 28 static void __init vpe_local_setup(unsigned int numvpes) 37 29 { 38 - int i; 39 - unsigned long timer_interrupt = 5, perf_interrupt = 5; 30 + unsigned long timer_interrupt = GIC_INT_TMR; 31 + unsigned long perf_interrupt = GIC_INT_PERFCTR; 40 32 unsigned int vpe_ctl; 33 + int i; 41 34 42 35 /* 43 36 * Setup the default performance counter timer interrupts ··· 82 79 bitmap_and(pending, pending, intrmask, GIC_NUM_INTRS); 83 80 bitmap_and(pending, pending, pcpu_mask, GIC_NUM_INTRS); 84 81 85 - i = find_first_bit(pending, GIC_NUM_INTRS); 86 - 87 - pr_debug("CPU%d: %s pend=%d\n", smp_processor_id(), __func__, i); 88 - 89 - return i; 82 + return find_first_bit(pending, GIC_NUM_INTRS); 90 83 } 91 84 92 85 static void gic_mask_irq(struct irq_data *d) 93 86 { 94 - unsigned int irq = d->irq - gic_irq_base; 95 - pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 96 - GIC_CLR_INTR_MASK(irq); 87 + GIC_CLR_INTR_MASK(d->irq - gic_irq_base); 97 88 } 98 89 99 90 static void gic_unmask_irq(struct irq_data *d) 100 91 { 101 - unsigned int irq = d->irq - gic_irq_base; 102 - pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 103 - GIC_SET_INTR_MASK(irq); 92 + GIC_SET_INTR_MASK(d->irq - gic_irq_base); 104 93 } 105 94 106 95 #ifdef CONFIG_SMP 107 - 108 96 static DEFINE_SPINLOCK(gic_lock); 109 97 110 98 static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask, 111 99 bool force) 112 100 { 113 - unsigned int irq = d->irq - gic_irq_base; 101 + unsigned int irq = (d->irq - gic_irq_base); 114 102 cpumask_t tmp = CPU_MASK_NONE; 115 103 unsigned long flags; 116 104 int i; 117 105 118 - pr_debug("%s(%d) called\n", __func__, irq); 119 106 cpumask_and(&tmp, cpumask, cpu_online_mask); 120 107 if (cpus_empty(tmp)) 121 108 return -1; ··· 169 176 170 177 /* Init Intr Masks */ 171 178 GIC_CLR_INTR_MASK(intr); 179 + 172 180 /* Initialise per-cpu Interrupt software masks */ 173 181 if (flags & GIC_FLAG_IPI) 174 182 set_bit(intr, pcpu_masks[cpu].pcpu_mask); ··· 230 236 231 237 numvpes = (gicconfig & GIC_SH_CONFIG_NUMVPES_MSK) >> 232 238 GIC_SH_CONFIG_NUMVPES_SHF; 233 - 234 - pr_debug("%s called\n", __func__); 235 239 236 240 gic_basic_init(numintrs, numvpes, intr_map, intr_map_size); 237 241