]> git.karo-electronics.de Git - linux-beck.git/commitdiff
EDAC: Sync memory types and names
authorBorislav Petkov <bp@suse.de>
Tue, 30 Sep 2014 18:38:54 +0000 (20:38 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 20 Oct 2014 12:22:50 +0000 (14:22 +0200)
Make keeping the sync between the mem_types enum and the actual string
names simpler by using designated initializers.

Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/edac/edac_mc.c

index 129ff9c36a7812dcddb5f96d70a83a16f11b4f0c..1747906f10cedcd2f9b528065b4ae139fc34fdb4 100644 (file)
@@ -125,30 +125,27 @@ static void edac_mc_dump_mci(struct mem_ctl_info *mci)
 
 #endif                         /* CONFIG_EDAC_DEBUG */
 
-/*
- * keep those in sync with the enum mem_type
- */
 const char * const edac_mem_types[] = {
-       "Empty csrow",
-       "Reserved csrow type",
-       "Unknown csrow type",
-       "Fast page mode RAM",
-       "Extended data out RAM",
-       "Burst Extended data out RAM",
-       "Single data rate SDRAM",
-       "Registered single data rate SDRAM",
-       "Double data rate SDRAM",
-       "Registered Double data rate SDRAM",
-       "Rambus DRAM",
-       "Unbuffered DDR2 RAM",
-       "Fully buffered DDR2",
-       "Registered DDR2 RAM",
-       "Rambus XDR",
-       "Unbuffered DDR3 RAM",
-       "Registered DDR3 RAM",
-       "Load-Reduced DDR3 RAM",
-       "Unbuffered DDR4 RAM",
-       "Registered DDR4 RAM",
+       [MEM_EMPTY]     = "Empty csrow",
+       [MEM_RESERVED]  = "Reserved csrow type",
+       [MEM_UNKNOWN]   = "Unknown csrow type",
+       [MEM_FPM]       = "Fast page mode RAM",
+       [MEM_EDO]       = "Extended data out RAM",
+       [MEM_BEDO]      = "Burst Extended data out RAM",
+       [MEM_SDR]       = "Single data rate SDRAM",
+       [MEM_RDR]       = "Registered single data rate SDRAM",
+       [MEM_DDR]       = "Double data rate SDRAM",
+       [MEM_RDDR]      = "Registered Double data rate SDRAM",
+       [MEM_RMBS]      = "Rambus DRAM",
+       [MEM_DDR2]      = "Unbuffered DDR2 RAM",
+       [MEM_FB_DDR2]   = "Fully buffered DDR2",
+       [MEM_RDDR2]     = "Registered DDR2 RAM",
+       [MEM_XDR]       = "Rambus XDR",
+       [MEM_DDR3]      = "Unbuffered DDR3 RAM",
+       [MEM_RDDR3]     = "Registered DDR3 RAM",
+       [MEM_LRDDR3]    = "Load-Reduced DDR3 RAM",
+       [MEM_DDR4]      = "Unbuffered DDR4 RAM",
+       [MEM_RDDR4]     = "Registered DDR4 RAM",
 };
 EXPORT_SYMBOL_GPL(edac_mem_types);