Also, you could restructure that function something like this to save yourself
an indentation level or two and make it more easily readable:
static uint32_t __init vmware_platform(void)
{
unsigned int hyper_vendor_id[3];
unsigned int eax;
if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
if (dmi_available && dmi_name_in_serial("VMware") && __vmware_platform())
return 1;
}
cpuid(CPUID_VMWARE_INFO_LEAF, &eax, &hyper_vendor_id[0],
&hyper_vendor_id[1], &hyper_vendor_id[2]);
if (!memcmp(hyper_vendor_id, "VMwareVMware", 12)) {
if (eax >= CPUID_VMWARE_FEATURES_LEAF)
vmware_hypercall_mode = vmware_select_hypercall();
pr_info("hypercall mode: 0x%02x\n", (unsigned int) vmware_hypercall_mode);
return CPUID_VMWARE_INFO_LEAF;
}
return 0;
}