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

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>

authored by

Hidetoshi Seto and committed by
Borislav Petkov
7639bfc7 a17957cd

+19 -20
+19 -20
arch/x86/kernel/cpu/mcheck/mce-severity.c
··· 99 99 ), 100 100 MCESEV( 101 101 KEEP, "Non signalled machine check", 102 - SER, MASK(MCI_STATUS_S, 0) 102 + SER, BITCLR(MCI_STATUS_S) 103 103 ), 104 104 105 105 /* AR add known MCACODs here */ 106 106 MCESEV( 107 107 PANIC, "Action required with lost events", 108 - SER, 109 - MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_OVER|MCI_UC_SAR) 108 + SER, BITSET(MCI_STATUS_OVER|MCI_UC_SAR) 110 109 ), 111 110 MCESEV( 112 - PANIC, "Action required; unknown MCACOD", 111 + PANIC, "Action required: unknown MCACOD", 113 112 SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_SAR) 114 113 ), 115 114 116 115 /* known AO MCACODs: */ 117 116 MCESEV( 118 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 120 MCESEV( 122 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 124 MCESEV( 126 - SOME, "Action optional unknown MCACOD", 125 + SOME, "Action optional: unknown MCACOD", 127 126 SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S) 128 127 ), 129 128 MCESEV( 130 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 133 MCESEV( 135 134 PANIC, "Overflowed uncorrected", 136 - BITSET(MCI_STATUS_UC|MCI_STATUS_OVER) 135 + BITSET(MCI_STATUS_OVER|MCI_STATUS_UC) 137 136 ), 138 137 MCESEV( 139 138 UC, "Uncorrected", ··· 156 157 return IN_KERNEL; 157 158 } 158 159 159 - int mce_severity(struct mce *a, int tolerant, char **msg) 160 + int mce_severity(struct mce *m, int tolerant, char **msg) 160 161 { 161 - enum context ctx = error_context(a); 162 + enum context ctx = error_context(m); 162 163 struct severity *s; 163 164 164 165 for (s = severities;; s++) { 165 - if ((a->status & s->mask) != s->result) 166 + if ((m->status & s->mask) != s->result) 166 167 continue; 167 - if ((a->mcgstatus & s->mcgmask) != s->mcgres) 168 + if ((m->mcgstatus & s->mcgmask) != s->mcgres) 168 169 continue; 169 170 if (s->ser == SER_REQUIRED && !mce_ser) 170 171 continue; ··· 241 242 242 243 static int __init severities_debugfs_init(void) 243 244 { 244 - struct dentry *dmce = NULL, *fseverities_coverage = NULL; 245 + struct dentry *dmce, *fsev; 245 246 246 247 dmce = mce_get_debugfs_dir(); 247 - if (dmce == NULL) 248 + if (!dmce) 248 249 goto err_out; 249 - fseverities_coverage = debugfs_create_file("severities-coverage", 250 - 0444, dmce, NULL, 251 - &severities_coverage_fops); 252 - if (fseverities_coverage == NULL) 250 + 251 + fsev = debugfs_create_file("severities-coverage", 0444, dmce, NULL, 252 + &severities_coverage_fops); 253 + if (!fsev) 253 254 goto err_out; 254 255 255 256 return 0; ··· 258 259 return -ENOMEM; 259 260 } 260 261 late_initcall(severities_debugfs_init); 261 - #endif 262 + #endif /* CONFIG_DEBUG_FS */