dmi_processor.c: remove unreachable table values
authorH. Peter Anvin <hpa@zytor.com>
Sun, 10 Jan 2010 21:18:48 +0000 (13:18 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 10 Jan 2010 21:18:48 +0000 (13:18 -0800)
A uint8_t can't have values all the way up to 0x12e...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/gpllib/dmi/dmi_processor.c

index fd007da..1cd9d1b 100644 (file)
@@ -49,7 +49,7 @@ const char *dmi_processor_type(uint8_t code)
 const char *dmi_processor_family(uint8_t code, char *manufacturer)
 {
     /* 3.3.5.2 */
-    static const char *family[] = {
+    static const char *family[256] = {
        NULL,                   /* 0x00 */
        "Other",
        "Unknown",
@@ -306,54 +306,6 @@ const char *dmi_processor_family(uint8_t code, char *manufacturer)
        NULL,
        NULL,
        NULL,                   /* 0xFF */
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       "SH-3",
-       "SH-4",
-       NULL,                   /*0x106*/
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,                   /*0x110*/
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,                   
-       "ARM",
-       "StrongARM",
-       NULL,                   /*0x19A*/
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   /*0x120*/
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   
-       NULL,                   /*0x12A*/
-       NULL,                   
-       "6x86",
-       "MediaGX",
-       "MII"                   /*0x12E*/
-           /* master.mif has values beyond that, but they can't be used for DMI */
     };
     /* Special case for ambiguous value 0xBE */
     if (code == 0xBE) {
@@ -367,7 +319,7 @@ const char *dmi_processor_family(uint8_t code, char *manufacturer)
        return "Core 2 or K7";
     }
 
-    if ((code<=0x12E) && (family[code] != NULL)) {
+    if (family[code] != NULL) {
        return family[code];
     }
     return out_of_spec;