From ffc891cd9c3eb846f4ef3ae83ad04f9ad7b976ac Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Mon, 21 Mar 2011 22:18:52 +0100 Subject: [PATCH] cpuid: Simplied structure init Let's zeroify everything and then init what is different from 0; --- com32/gpllib/cpuid.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/com32/gpllib/cpuid.c b/com32/gpllib/cpuid.c index be33390..26ee14b 100644 --- a/com32/gpllib/cpuid.c +++ b/com32/gpllib/cpuid.c @@ -458,17 +458,11 @@ void set_generic_info(struct cpuinfo_x86 *c, s_cpu * cpu) void detect_cpu(s_cpu * cpu) { struct cpuinfo_x86 c; + memset(&c,0,sizeof(c)); c.x86_clflush_size = 32; - c.x86_l1_data_cache_size = 0; - c.x86_l1_instruction_cache_size = 0; - c.x86_l2_cache_size = 0; c.x86_vendor = X86_VENDOR_UNKNOWN; c.cpuid_level = -1; /* CPUID not detected */ - c.x86_model = c.x86_mask = 0; /* So far unknown... */ c.x86_num_cores = 1; - memset(&c.x86_capability, 0, sizeof(c.x86_capability)); - memset(&c.x86_vendor_id, 0, sizeof(c.x86_vendor_id)); - memset(&c.x86_model_id, 0, sizeof(c.x86_model_id)); memset(&cpu->flags, 0, sizeof(s_cpu_flags)); if (!have_cpuid_p()) -- 2.7.4