diff options
author | Dave Peterson <dsp@llnl.gov> | 2006-03-26 04:38:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:57:06 -0500 |
commit | 537fba28928c01b7db1580627450691a4bb0b9b3 (patch) | |
tree | 1fd5adaa38ba639e28b56e014bfb309c0d1e181e /drivers/edac/edac_mc.h | |
parent | f2fe42abbf0d99a8c4b96f1cc55db10ac35d2fb9 (diff) |
[PATCH] EDAC: printk cleanup
This implements the following idea:
On Monday 30 January 2006 19:22, Eric W. Biederman wrote:
> One piece missing from this conversation is the issue that we need errors
> in a uniform format. That is why edac_mc has helper functions.
>
> However there will always be errors that don't fit any particular model.
> Could we add a edac_printk(dev, ); That is similar to dev_printk but
> prints out an EDAC header and the device on which the error was found?
> Letting the rest of the string be user specified.
>
> For actual control that interface may be to blunt, but at least for people
> looking in the logs it allows all of the errors to be detected and
> harvested.
Signed-off-by: David S. Peterson <dsp@llnl.gov>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/edac/edac_mc.h')
-rw-r--r-- | drivers/edac/edac_mc.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/edac/edac_mc.h b/drivers/edac/edac_mc.h index 75ecf484a43a..4bd8375a8d7e 100644 --- a/drivers/edac/edac_mc.h +++ b/drivers/edac/edac_mc.h | |||
@@ -43,10 +43,29 @@ | |||
43 | #define PAGES_TO_MiB( pages ) ( ( pages ) << ( PAGE_SHIFT - 20 ) ) | 43 | #define PAGES_TO_MiB( pages ) ( ( pages ) << ( PAGE_SHIFT - 20 ) ) |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | #define edac_printk(level, prefix, fmt, arg...) \ | ||
47 | printk(level "EDAC " prefix ": " fmt, ##arg) | ||
48 | |||
49 | #define edac_mc_printk(mci, level, fmt, arg...) \ | ||
50 | printk(level "EDAC MC%d: " fmt, mci->mc_idx, ##arg) | ||
51 | |||
52 | #define edac_mc_chipset_printk(mci, level, prefix, fmt, arg...) \ | ||
53 | printk(level "EDAC " prefix " MC%d: " fmt, mci->mc_idx, ##arg) | ||
54 | |||
55 | /* prefixes for edac_printk() and edac_mc_printk() */ | ||
56 | #define EDAC_MC "MC" | ||
57 | #define EDAC_PCI "PCI" | ||
58 | #define EDAC_DEBUG "DEBUG" | ||
59 | |||
46 | #ifdef CONFIG_EDAC_DEBUG | 60 | #ifdef CONFIG_EDAC_DEBUG |
47 | extern int edac_debug_level; | 61 | extern int edac_debug_level; |
48 | #define edac_debug_printk(level, fmt, args...) \ | 62 | |
49 | do { if (level <= edac_debug_level) printk(KERN_DEBUG fmt, ##args); } while(0) | 63 | #define edac_debug_printk(level, fmt, arg...) \ |
64 | do { \ | ||
65 | if (level <= edac_debug_level) \ | ||
66 | edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \ | ||
67 | } while(0) | ||
68 | |||
50 | #define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ ) | 69 | #define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ ) |
51 | #define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ ) | 70 | #define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ ) |
52 | #define debugf2( ... ) edac_debug_printk(2, __VA_ARGS__ ) | 71 | #define debugf2( ... ) edac_debug_printk(2, __VA_ARGS__ ) |