From a29be61de04d4b263e9d28136ad2b79e8b9dea16 Mon Sep 17 00:00:00 2001 From: cheloha Date: Mon, 26 Jun 2023 16:26:20 +0000 Subject: [PATCH] timeout_hardclock_update: provide initial value for automatic variables --- sys/kern/kern_timeout.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index ef72572c36c..dcd0280b2ce 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.90 2022/12/31 16:06:24 cheloha Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.91 2023/06/26 16:26:20 cheloha Exp $ */ /* * Copyright (c) 2001 Thomas Nordin * Copyright (c) 2000-2001 Artur Grabowski @@ -542,13 +542,11 @@ timeout_hardclock_update(void) { struct timespec elapsed, now; struct kclock *kc; - struct timespec *lastscan; - int b, done, first, i, last, level, need_softclock, off; + struct timespec *lastscan = &timeout_kclock[KCLOCK_UPTIME].kc_lastscan; + int b, done, first, i, last, level, need_softclock = 1, off; nanouptime(&now); - lastscan = &timeout_kclock[KCLOCK_UPTIME].kc_lastscan; timespecsub(&now, lastscan, &elapsed); - need_softclock = 1; mtx_enter(&timeout_mutex); -- 2.20.1