firmware: dmi: Add info message for number of populated and total memory slots
[linux-2.6-block.git] / drivers / firmware / dmi_scan.c
index ac2a5d2d47463f121a4a13e2cc3b7894bce64d4c..68231c638c552e129b43395e2647ad31feceb216 100644 (file)
@@ -42,6 +42,7 @@ static struct dmi_memdev_info {
        u8 type;                /* DDR2, DDR3, DDR4 etc */
 } *dmi_memdev;
 static int dmi_memdev_nr;
+static int dmi_memdev_populated_nr __initdata;
 
 static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
 {
@@ -459,6 +460,9 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v)
        else
                bytes = (u64)get_unaligned((u32 *)&d[0x1C]) << 20;
 
+       if (bytes)
+               dmi_memdev_populated_nr++;
+
        dmi_memdev[nr].size = bytes;
        nr++;
 }
@@ -835,6 +839,8 @@ void __init dmi_setup(void)
                return;
 
        dmi_memdev_walk();
+       pr_info("DMI: Memory slots populated: %d/%d\n",
+               dmi_memdev_populated_nr, dmi_memdev_nr);
        dump_stack_set_arch_desc("%s", dmi_ids_string);
 }