]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove an unused variable from the "VMware Tools for Linux-Arm" build
authorOliver Kurth <okurth@vmware.com>
Thu, 5 Dec 2019 19:34:43 +0000 (11:34 -0800)
committerOliver Kurth <okurth@vmware.com>
Thu, 5 Dec 2019 19:34:43 +0000 (11:34 -0800)
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.

open-vm-tools/lib/vmCheck/vmcheck.c

index 8fdb326527884874993fb754855a83c2da7514c6..6be0ebf4c98e2457578b5eb67cba344d2dda3fb4 100644 (file)
 
 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;
             }