]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/misc: pick up review comments
authorVMware, Inc <>
Tue, 13 Mar 2012 19:59:59 +0000 (12:59 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Tue, 13 Mar 2012 22:45:03 +0000 (15:45 -0700)
Regis had a few, nice suggestions.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/lib/misc/hostinfoPosix.c

index 10a5ea57a51e7d8dd3c6a19172bd5b07f682bb6e..ef917d9bdebd9a661c2d6920bd6f3c065a4eb6a7 100644 (file)
@@ -1611,9 +1611,8 @@ HostinfoSystemTimerMach(VmTimeType *result)  // OUT
 #  define vmx86_apple 1
 
    typedef struct {
-      mach_timebase_info_data_t timeBase;
-      double                    scalingFactor;
-      Bool                      unity;
+      double  scalingFactor;
+      Bool    unity;
    } timerData;
 
    VmTimeType raw;
@@ -1629,17 +1628,18 @@ HostinfoSystemTimerMach(VmTimeType *result)  // OUT
    ptr = Atomic_ReadPtr(&atomic);
 
    if (UNLIKELY(ptr == NULL)) {
-      timerData *new = Util_SafeMalloc(sizeof *new);
+      mach_timebase_info_data_t timeBase;
+      timerData *try = Util_SafeMalloc(sizeof *try);
 
-      mach_timebase_info(&new->timeBase);
+      mach_timebase_info(&timeBase);
 
-      new->scalingFactor = ((double) new->timeBase.numer) /
-                           ((double) new->timeBase.denom);
+      try->scalingFactor = ((double) timeBase.numer) /
+                           ((double) timeBase.denom);
 
-      new->unity = ((new->timeBase.numer == 1) && (new->timeBase.denom == 1));
+      try->unity = ((timeBase.numer == 1) && (timeBase.denom == 1));
 
-      if (Atomic_ReadIfEqualWritePtr(&atomic, NULL, new)) {
-         free(new);
+      if (Atomic_ReadIfEqualWritePtr(&atomic, NULL, try)) {
+         free(try);
       }
 
       ptr = Atomic_ReadPtr(&atomic);