From: Oliver Kurth Date: Thu, 5 Dec 2019 19:34:43 +0000 (-0800) Subject: Remove an unused variable from the "VMware Tools for Linux-Arm" build X-Git-Tag: stable-11.1.0~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6b2c50803a7656522265b59e22b77fce6b317c8;p=thirdparty%2Fopen-vm-tools.git Remove an unused variable from the "VMware Tools for Linux-Arm" build The gHvVendor variable is unused when building for arm64. So move the variable declaration next to the only x86 code which uses the variable, and rename the variable since it is no longer global. --- diff --git a/open-vm-tools/lib/vmCheck/vmcheck.c b/open-vm-tools/lib/vmCheck/vmcheck.c index 8fdb32652..6be0ebf4c 100644 --- a/open-vm-tools/lib/vmCheck/vmcheck.c +++ b/open-vm-tools/lib/vmCheck/vmcheck.c @@ -70,16 +70,6 @@ typedef Bool (*SafeCheckFn)(void); -#if !defined(WINNT_DDK) -static const struct { - const char *vendorSig; - const char *hypervisorName; -} gHvVendor[] = { - {CPUID_KVM_HYPERVISOR_VENDOR_STRING, "Linux KVM"}, - {CPUID_XEN_HYPERVISOR_VENDOR_STRING, "Xen"}, -}; -#endif - #if !defined(_WIN32) static sigjmp_buf jmpBuf; @@ -285,10 +275,18 @@ VmCheck_IsVirtualWorld(void) if (hypervisorSig == NULL || Str_Strcmp(hypervisorSig, CPUID_VMWARE_HYPERVISOR_VENDOR_STRING) != 0) { if (hypervisorSig != NULL) { - for (i = 0; i < ARRAYSIZE(gHvVendor); i++) { - if (Str_Strcmp(hypervisorSig, gHvVendor[i].vendorSig) == 0) { + static const struct { + const char *vendorSig; + const char *hypervisorName; + } hvVendors[] = { + { CPUID_KVM_HYPERVISOR_VENDOR_STRING, "Linux KVM" }, + { CPUID_XEN_HYPERVISOR_VENDOR_STRING, "Xen" }, + }; + + for (i = 0; i < ARRAYSIZE(hvVendors); i++) { + if (Str_Strcmp(hypervisorSig, hvVendors[i].vendorSig) == 0) { Debug("%s: detected %s.\n", __FUNCTION__, - gHvVendor[i].hypervisorName); + hvVendors[i].hypervisorName); free(hypervisorSig); return FALSE; }