[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/HPET: simplify "expire" check a little in reprogram_hpet_evt_channel()



commit 712416dc443315da604d69f6d36b28c6744578f0
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jan 22 14:12:54 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: simplify "expire" check a little in reprogram_hpet_evt_channel()
    
    When this was added, the log message was updated correctly, but the zero
    case was needlessly checked separately: hpet_broadcast_enter() had a zero
    check added at the same time, while handle_hpet_broadcast() can't possibly
    pass 0 here anyway.
    
    Also turn the printk() there into an assertion: NOW() should only ever
    return valid (positive) values.
    
    Fixes: 7145897cfb81 ("cpuidle: Fix for timer_deadline==0 case")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/hpet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 368c6eb4a0..65253a3f6c 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -147,12 +147,12 @@ static int reprogram_hpet_evt_channel(
     int64_t delta;
     int ret;
 
-    if ( (ch->flags & HPET_EVT_DISABLE) || (expire == 0) )
+    if ( ch->flags & HPET_EVT_DISABLE )
         return 0;
 
-    if ( unlikely(expire < 0) )
+    if ( unlikely(expire <= 0) )
     {
-        printk(KERN_DEBUG "reprogram: expire <= 0\n");
+        ASSERT_UNREACHABLE();
         return -ETIME;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.