From: cheloha Date: Mon, 26 Jun 2023 16:26:20 +0000 (+0000) Subject: timeout_hardclock_update: provide initial value for automatic variables X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a29be61de04d4b263e9d28136ad2b79e8b9dea16;p=openbsd timeout_hardclock_update: provide initial value for automatic variables --- 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);