diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2011-06-07 21:55:05 -0400 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2011-06-16 06:10:07 -0400 |
commit | 7639bfc753f70321dbea83852e1cc47a45b681d7 (patch) | |
tree | fcc7c32a656f3d63a02dfec11e59e32f7cdffd52 /arch/x86/kernel | |
parent | a17957cdec69acb9e26319618b95a810a936e637 (diff) |
x86, mce, severity: Clean up trivial coding style problems
More specifically:
- sort bits in the macros
- use BITCLR/BITSET
- coordinate message pattern
- use m for struct mce
- cleanup for severities_debugfs_init()
No functional change.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Acked-by: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/4DEED679.9090503@jp.fujitsu.com
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-severity.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c index 27e778eac8c6..7395d5f4272d 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-severity.c +++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c | |||
@@ -99,41 +99,40 @@ static struct severity { | |||
99 | ), | 99 | ), |
100 | MCESEV( | 100 | MCESEV( |
101 | KEEP, "Non signalled machine check", | 101 | KEEP, "Non signalled machine check", |
102 | SER, MASK(MCI_STATUS_S, 0) | 102 | SER, BITCLR(MCI_STATUS_S) |
103 | ), | 103 | ), |
104 | 104 | ||
105 | /* AR add known MCACODs here */ | 105 | /* AR add known MCACODs here */ |
106 | MCESEV( | 106 | MCESEV( |
107 | PANIC, "Action required with lost events", | 107 | PANIC, "Action required with lost events", |
108 | SER, | 108 | SER, BITSET(MCI_STATUS_OVER|MCI_UC_SAR) |
109 | MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_OVER|MCI_UC_SAR) | ||
110 | ), | 109 | ), |
111 | MCESEV( | 110 | MCESEV( |
112 | PANIC, "Action required; unknown MCACOD", | 111 | PANIC, "Action required: unknown MCACOD", |
113 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_SAR) | 112 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_SAR) |
114 | ), | 113 | ), |
115 | 114 | ||
116 | /* known AO MCACODs: */ | 115 | /* known AO MCACODs: */ |
117 | MCESEV( | 116 | MCESEV( |
118 | AO, "Action optional: memory scrubbing error", | 117 | AO, "Action optional: memory scrubbing error", |
119 | SER, MASK(MCI_UC_SAR|MCI_STATUS_OVER|0xfff0, MCI_UC_S|0xc0) | 118 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|0xfff0, MCI_UC_S|0x00c0) |
120 | ), | 119 | ), |
121 | MCESEV( | 120 | MCESEV( |
122 | AO, "Action optional: last level cache writeback error", | 121 | AO, "Action optional: last level cache writeback error", |
123 | SER, MASK(MCI_UC_SAR|MCI_STATUS_OVER|MCACOD, MCI_UC_S|0x17a) | 122 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCACOD, MCI_UC_S|0x017a) |
124 | ), | 123 | ), |
125 | MCESEV( | 124 | MCESEV( |
126 | SOME, "Action optional unknown MCACOD", | 125 | SOME, "Action optional: unknown MCACOD", |
127 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S) | 126 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S) |
128 | ), | 127 | ), |
129 | MCESEV( | 128 | MCESEV( |
130 | SOME, "Action optional with lost events", | 129 | SOME, "Action optional with lost events", |
131 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S|MCI_STATUS_OVER) | 130 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_OVER|MCI_UC_S) |
132 | ), | 131 | ), |
133 | 132 | ||
134 | MCESEV( | 133 | MCESEV( |
135 | PANIC, "Overflowed uncorrected", | 134 | PANIC, "Overflowed uncorrected", |
136 | BITSET(MCI_STATUS_UC|MCI_STATUS_OVER) | 135 | BITSET(MCI_STATUS_OVER|MCI_STATUS_UC) |
137 | ), | 136 | ), |
138 | MCESEV( | 137 | MCESEV( |
139 | UC, "Uncorrected", | 138 | UC, "Uncorrected", |
@@ -157,15 +156,15 @@ static int error_context(struct mce *m) | |||
157 | return IN_KERNEL; | 156 | return IN_KERNEL; |
158 | } | 157 | } |
159 | 158 | ||
160 | int mce_severity(struct mce *a, int tolerant, char **msg) | 159 | int mce_severity(struct mce *m, int tolerant, char **msg) |
161 | { | 160 | { |
162 | enum context ctx = error_context(a); | 161 | enum context ctx = error_context(m); |
163 | struct severity *s; | 162 | struct severity *s; |
164 | 163 | ||
165 | for (s = severities;; s++) { | 164 | for (s = severities;; s++) { |
166 | if ((a->status & s->mask) != s->result) | 165 | if ((m->status & s->mask) != s->result) |
167 | continue; | 166 | continue; |
168 | if ((a->mcgstatus & s->mcgmask) != s->mcgres) | 167 | if ((m->mcgstatus & s->mcgmask) != s->mcgres) |
169 | continue; | 168 | continue; |
170 | if (s->ser == SER_REQUIRED && !mce_ser) | 169 | if (s->ser == SER_REQUIRED && !mce_ser) |
171 | continue; | 170 | continue; |
@@ -242,15 +241,15 @@ static const struct file_operations severities_coverage_fops = { | |||
242 | 241 | ||
243 | static int __init severities_debugfs_init(void) | 242 | static int __init severities_debugfs_init(void) |
244 | { | 243 | { |
245 | struct dentry *dmce = NULL, *fseverities_coverage = NULL; | 244 | struct dentry *dmce, *fsev; |
246 | 245 | ||
247 | dmce = mce_get_debugfs_dir(); | 246 | dmce = mce_get_debugfs_dir(); |
248 | if (dmce == NULL) | 247 | if (!dmce) |
249 | goto err_out; | 248 | goto err_out; |
250 | fseverities_coverage = debugfs_create_file("severities-coverage", | 249 | |
251 | 0444, dmce, NULL, | 250 | fsev = debugfs_create_file("severities-coverage", 0444, dmce, NULL, |
252 | &severities_coverage_fops); | 251 | &severities_coverage_fops); |
253 | if (fseverities_coverage == NULL) | 252 | if (!fsev) |
254 | goto err_out; | 253 | goto err_out; |
255 | 254 | ||
256 | return 0; | 255 | return 0; |
@@ -259,4 +258,4 @@ err_out: | |||
259 | return -ENOMEM; | 258 | return -ENOMEM; |
260 | } | 259 | } |
261 | late_initcall(severities_debugfs_init); | 260 | late_initcall(severities_debugfs_init); |
262 | #endif | 261 | #endif /* CONFIG_DEBUG_FS */ |