diff options
author | Joe Perches <joe@perches.com> | 2012-04-28 15:41:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-06-11 12:23:48 -0400 |
commit | 7e881856eee8b889b76cd1d8e04ce2fc79b72099 (patch) | |
tree | 1cd297b48d2193bce416a5516583fe65630c2d45 /drivers/edac/i5000_edac.c | |
parent | dd23cd6eb1f59ba722a6e6aa228adff7c01404de (diff) |
edac: Use more normal debugging macro style
Convert macros to a simpler style and enforce appropriate
format checking when not CONFIG_EDAC_DEBUG.
Use fmt and __VA_ARGS__, neaten macros.
Move some string arrays to the debugfx uses and remove the
now unnecessary CONFIG_EDAC_DEBUG variable block definitions.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac/i5000_edac.c')
-rw-r--r-- | drivers/edac/i5000_edac.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c index 4a5ca5229d5f..0e16db620ad5 100644 --- a/drivers/edac/i5000_edac.c +++ b/drivers/edac/i5000_edac.c | |||
@@ -273,7 +273,7 @@ | |||
273 | #define CHANNELS_PER_BRANCH 2 | 273 | #define CHANNELS_PER_BRANCH 2 |
274 | #define MAX_BRANCHES 2 | 274 | #define MAX_BRANCHES 2 |
275 | 275 | ||
276 | /* Defines to extract the vaious fields from the | 276 | /* Defines to extract the various fields from the |
277 | * MTRx - Memory Technology Registers | 277 | * MTRx - Memory Technology Registers |
278 | */ | 278 | */ |
279 | #define MTR_DIMMS_PRESENT(mtr) ((mtr) & (0x1 << 8)) | 279 | #define MTR_DIMMS_PRESENT(mtr) ((mtr) & (0x1 << 8)) |
@@ -287,22 +287,6 @@ | |||
287 | #define MTR_DIMM_COLS(mtr) ((mtr) & 0x3) | 287 | #define MTR_DIMM_COLS(mtr) ((mtr) & 0x3) |
288 | #define MTR_DIMM_COLS_ADDR_BITS(mtr) (MTR_DIMM_COLS(mtr) + 10) | 288 | #define MTR_DIMM_COLS_ADDR_BITS(mtr) (MTR_DIMM_COLS(mtr) + 10) |
289 | 289 | ||
290 | #ifdef CONFIG_EDAC_DEBUG | ||
291 | static char *numrow_toString[] = { | ||
292 | "8,192 - 13 rows", | ||
293 | "16,384 - 14 rows", | ||
294 | "32,768 - 15 rows", | ||
295 | "reserved" | ||
296 | }; | ||
297 | |||
298 | static char *numcol_toString[] = { | ||
299 | "1,024 - 10 columns", | ||
300 | "2,048 - 11 columns", | ||
301 | "4,096 - 12 columns", | ||
302 | "reserved" | ||
303 | }; | ||
304 | #endif | ||
305 | |||
306 | /* enables the report of miscellaneous messages as CE errors - default off */ | 290 | /* enables the report of miscellaneous messages as CE errors - default off */ |
307 | static int misc_messages; | 291 | static int misc_messages; |
308 | 292 | ||
@@ -989,8 +973,16 @@ static void decode_mtr(int slot_row, u16 mtr) | |||
989 | debugf2("\t\tWIDTH: x%d\n", MTR_DRAM_WIDTH(mtr)); | 973 | debugf2("\t\tWIDTH: x%d\n", MTR_DRAM_WIDTH(mtr)); |
990 | debugf2("\t\tNUMBANK: %d bank(s)\n", MTR_DRAM_BANKS(mtr)); | 974 | debugf2("\t\tNUMBANK: %d bank(s)\n", MTR_DRAM_BANKS(mtr)); |
991 | debugf2("\t\tNUMRANK: %s\n", MTR_DIMM_RANK(mtr) ? "double" : "single"); | 975 | debugf2("\t\tNUMRANK: %s\n", MTR_DIMM_RANK(mtr) ? "double" : "single"); |
992 | debugf2("\t\tNUMROW: %s\n", numrow_toString[MTR_DIMM_ROWS(mtr)]); | 976 | debugf2("\t\tNUMROW: %s\n", |
993 | debugf2("\t\tNUMCOL: %s\n", numcol_toString[MTR_DIMM_COLS(mtr)]); | 977 | MTR_DIMM_ROWS(mtr) == 0 ? "8,192 - 13 rows" : |
978 | MTR_DIMM_ROWS(mtr) == 1 ? "16,384 - 14 rows" : | ||
979 | MTR_DIMM_ROWS(mtr) == 2 ? "32,768 - 15 rows" : | ||
980 | "reserved"); | ||
981 | debugf2("\t\tNUMCOL: %s\n", | ||
982 | MTR_DIMM_COLS(mtr) == 0 ? "1,024 - 10 columns" : | ||
983 | MTR_DIMM_COLS(mtr) == 1 ? "2,048 - 11 columns" : | ||
984 | MTR_DIMM_COLS(mtr) == 2 ? "4,096 - 12 columns" : | ||
985 | "reserved"); | ||
994 | } | 986 | } |
995 | 987 | ||
996 | static void handle_channel(struct i5000_pvt *pvt, int slot, int channel, | 988 | static void handle_channel(struct i5000_pvt *pvt, int slot, int channel, |