VirtualBox

Changeset 81966 in vbox


Ignore:
Timestamp:
Nov 18, 2019 8:51:08 PM (5 years ago)
Author:
vboxsync
Message:

DevHPET: Nits. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevHPET.cpp

    r81965 r81966  
    389389
    390390        u32Diff = (uint32_t)pHpetTimer->u64Cmp - (uint32_t)u64Now;
    391         u32Diff = ((int32_t)u32Diff > 0) ? u32Diff : (uint32_t)0;
     391        u32Diff = (int32_t)u32Diff > 0 ? u32Diff : (uint32_t)0;
    392392        return (uint64_t)u32Diff;
    393393    }
    394     else
    395     {
    396         uint64_t u64Diff;
    397 
    398         u64Diff = pHpetTimer->u64Cmp - u64Now;
    399         u64Diff = ((int64_t)u64Diff > 0) ?  u64Diff : (uint64_t)0;
    400         return u64Diff;
    401     }
     394    uint64_t u64Diff;
     395
     396    u64Diff = pHpetTimer->u64Cmp - u64Now;
     397    u64Diff = (int64_t)u64Diff > 0 ?  u64Diff : (uint64_t)0;
     398    return u64Diff;
    402399}
    403400
     
    405402static void hpetAdjustComparator(PHPETTIMER pHpetTimer, uint64_t u64Now)
    406403{
    407     uint64_t    u64Period = pHpetTimer->u64Period;
    408 
    409     if ((pHpetTimer->u64Config & HPET_TN_PERIODIC) && u64Period)
    410     {
    411           uint64_t  cPeriods = (u64Now - pHpetTimer->u64Cmp) / u64Period;
    412 
    413           pHpetTimer->u64Cmp += (cPeriods + 1) * u64Period;
     404    if ((pHpetTimer->u64Config & HPET_TN_PERIODIC))
     405    {
     406        uint64_t u64Period = pHpetTimer->u64Period;
     407        if (u64Period)
     408        {
     409            uint64_t  cPeriods = (u64Now - pHpetTimer->u64Cmp) / u64Period;
     410            pHpetTimer->u64Cmp += (cPeriods + 1) * u64Period;
     411        }
    414412    }
    415413}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette