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

x86: coding style fixes to arch/x86/oprofile/op_model_athlon.c

The patch fixes 33 errors and a few warnings reported by checkpatch.pl

arch/x86/oprofile/op_model_athlon.o:
text data bss dec hex filename
1691 0 32 1723 6bb op_model_athlon.o.before
1691 0 32 1723 6bb op_model_athlon.o.after
md5:
c354bc2d7140e1e626c03390eddaa0a6 op_model_athlon.o.before.asm
c354bc2d7140e1e626c03390eddaa0a6 op_model_athlon.o.after.asm

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Paolo Ciarrocchi and committed by
Ingo Molnar
d4413732 8b45b72b

+23 -23
+23 -23
arch/x86/oprofile/op_model_athlon.c
··· 1 - /** 1 + /* 2 2 * @file op_model_athlon.h 3 3 * athlon / K7 / K8 / Family 10h model-specific MSR operations 4 4 * ··· 14 14 #include <asm/ptrace.h> 15 15 #include <asm/msr.h> 16 16 #include <asm/nmi.h> 17 - 17 + 18 18 #include "op_x86_model.h" 19 19 #include "op_counter.h" 20 20 21 21 #define NUM_COUNTERS 4 22 22 #define NUM_CONTROLS 4 23 23 24 - #define CTR_IS_RESERVED(msrs,c) (msrs->counters[(c)].addr ? 1 : 0) 25 - #define CTR_READ(l,h,msrs,c) do {rdmsr(msrs->counters[(c)].addr, (l), (h));} while (0) 26 - #define CTR_WRITE(l,msrs,c) do {wrmsr(msrs->counters[(c)].addr, -(unsigned int)(l), -1);} while (0) 24 + #define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0) 25 + #define CTR_READ(l, h, msrs, c) do {rdmsr(msrs->counters[(c)].addr, (l), (h)); } while (0) 26 + #define CTR_WRITE(l, msrs, c) do {wrmsr(msrs->counters[(c)].addr, -(unsigned int)(l), -1); } while (0) 27 27 #define CTR_OVERFLOWED(n) (!((n) & (1U<<31))) 28 28 29 - #define CTRL_IS_RESERVED(msrs,c) (msrs->controls[(c)].addr ? 1 : 0) 30 - #define CTRL_READ(l,h,msrs,c) do {rdmsr(msrs->controls[(c)].addr, (l), (h));} while (0) 31 - #define CTRL_WRITE(l,h,msrs,c) do {wrmsr(msrs->controls[(c)].addr, (l), (h));} while (0) 29 + #define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0) 30 + #define CTRL_READ(l, h, msrs, c) do {rdmsr(msrs->controls[(c)].addr, (l), (h)); } while (0) 31 + #define CTRL_WRITE(l, h, msrs, c) do {wrmsr(msrs->controls[(c)].addr, (l), (h)); } while (0) 32 32 #define CTRL_SET_ACTIVE(n) (n |= (1<<22)) 33 33 #define CTRL_SET_INACTIVE(n) (n &= ~(1<<22)) 34 34 #define CTRL_CLEAR_LO(x) (x &= (1<<21)) 35 35 #define CTRL_CLEAR_HI(x) (x &= 0xfffffcf0) 36 36 #define CTRL_SET_ENABLE(val) (val |= 1<<20) 37 - #define CTRL_SET_USR(val,u) (val |= ((u & 1) << 16)) 38 - #define CTRL_SET_KERN(val,k) (val |= ((k & 1) << 17)) 37 + #define CTRL_SET_USR(val, u) (val |= ((u & 1) << 16)) 38 + #define CTRL_SET_KERN(val, k) (val |= ((k & 1) << 17)) 39 39 #define CTRL_SET_UM(val, m) (val |= (m << 8)) 40 40 #define CTRL_SET_EVENT_LOW(val, e) (val |= (e & 0xff)) 41 41 #define CTRL_SET_EVENT_HIGH(val, e) (val |= ((e >> 8) & 0xf)) ··· 43 43 #define CTRL_SET_GUEST_ONLY(val, h) (val |= ((h & 1) << 8)) 44 44 45 45 static unsigned long reset_value[NUM_COUNTERS]; 46 - 46 + 47 47 static void athlon_fill_in_addresses(struct op_msrs * const msrs) 48 48 { 49 49 int i; 50 50 51 - for (i=0; i < NUM_COUNTERS; i++) { 51 + for (i = 0; i < NUM_COUNTERS; i++) { 52 52 if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i)) 53 53 msrs->counters[i].addr = MSR_K7_PERFCTR0 + i; 54 54 else 55 55 msrs->counters[i].addr = 0; 56 56 } 57 57 58 - for (i=0; i < NUM_CONTROLS; i++) { 58 + for (i = 0; i < NUM_CONTROLS; i++) { 59 59 if (reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i)) 60 60 msrs->controls[i].addr = MSR_K7_EVNTSEL0 + i; 61 61 else ··· 63 63 } 64 64 } 65 65 66 - 66 + 67 67 static void athlon_setup_ctrs(struct op_msrs const * const msrs) 68 68 { 69 69 unsigned int low, high; 70 70 int i; 71 - 71 + 72 72 /* clear all counters */ 73 73 for (i = 0 ; i < NUM_CONTROLS; ++i) { 74 - if (unlikely(!CTRL_IS_RESERVED(msrs,i))) 74 + if (unlikely(!CTRL_IS_RESERVED(msrs, i))) 75 75 continue; 76 76 CTRL_READ(low, high, msrs, i); 77 77 CTRL_CLEAR_LO(low); ··· 81 81 82 82 /* avoid a false detection of ctr overflows in NMI handler */ 83 83 for (i = 0; i < NUM_COUNTERS; ++i) { 84 - if (unlikely(!CTR_IS_RESERVED(msrs,i))) 84 + if (unlikely(!CTR_IS_RESERVED(msrs, i))) 85 85 continue; 86 86 CTR_WRITE(1, msrs, i); 87 87 } 88 88 89 89 /* enable active counters */ 90 90 for (i = 0; i < NUM_COUNTERS; ++i) { 91 - if ((counter_config[i].enabled) && (CTR_IS_RESERVED(msrs,i))) { 91 + if ((counter_config[i].enabled) && (CTR_IS_RESERVED(msrs, i))) { 92 92 reset_value[i] = counter_config[i].count; 93 93 94 94 CTR_WRITE(counter_config[i].count, msrs, i); ··· 112 112 } 113 113 } 114 114 115 - 115 + 116 116 static int athlon_check_ctrs(struct pt_regs * const regs, 117 117 struct op_msrs const * const msrs) 118 118 { ··· 133 133 return 1; 134 134 } 135 135 136 - 136 + 137 137 static void athlon_start(struct op_msrs const * const msrs) 138 138 { 139 139 unsigned int low, high; ··· 150 150 151 151 static void athlon_stop(struct op_msrs const * const msrs) 152 152 { 153 - unsigned int low,high; 153 + unsigned int low, high; 154 154 int i; 155 155 156 156 /* Subtle: stop on all counters to avoid race with ··· 169 169 int i; 170 170 171 171 for (i = 0 ; i < NUM_COUNTERS ; ++i) { 172 - if (CTR_IS_RESERVED(msrs,i)) 172 + if (CTR_IS_RESERVED(msrs, i)) 173 173 release_perfctr_nmi(MSR_K7_PERFCTR0 + i); 174 174 } 175 175 for (i = 0 ; i < NUM_CONTROLS ; ++i) { 176 - if (CTRL_IS_RESERVED(msrs,i)) 176 + if (CTRL_IS_RESERVED(msrs, i)) 177 177 release_evntsel_nmi(MSR_K7_EVNTSEL0 + i); 178 178 } 179 179 }