Skip to content

Commit

Permalink
accel/tcg/icount-common: Consolidate the use of warn_report_once()
Browse files Browse the repository at this point in the history
Use warn_report_once() to get rid of the static local variable "notified".

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240418100716.1085491-1-zhao1.liu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
trueptolemy authored and bonzini committed Apr 23, 2024
1 parent aec202c commit 94da7b6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions accel/tcg/icount-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,8 @@ void icount_start_warp_timer(void)
deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
~QEMU_TIMER_ATTR_EXTERNAL);
if (deadline < 0) {
static bool notified;
if (!icount_sleep && !notified) {
warn_report("icount sleep disabled and no active timers");
notified = true;
if (!icount_sleep) {
warn_report_once("icount sleep disabled and no active timers");
}
return;
}
Expand Down

0 comments on commit 94da7b6

Please sign in to comment.