From 21b66f45422bc449d4a8b86ab452d6b6ae5838bf Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 6 Jun 2016 17:16:44 +0100 Subject: [PATCH] sim: Only print the power state transition warning once A lot of objects seem to request no-op power transitions which currently results in large amounts of warnings. These warnings are benign and risk hiding more serious warnings. Make the warning a warn_once to prevent console flooding. Change-Id: I86c74b4224b167f14469250ef86ab69fde7a227e Signed-off-by: Andreas Sandberg --- src/sim/clocked_object.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sim/clocked_object.cc b/src/sim/clocked_object.cc index 44b25cd5d..f0b176509 100644 --- a/src/sim/clocked_object.cc +++ b/src/sim/clocked_object.cc @@ -78,8 +78,8 @@ ClockedObject::pwrState(Enums::PwrState p) { // Function should ideally be called only when there is a state change if (_currPwrState == p) { - warn("ClockedObject: Already in the requested power state, request "\ - "ignored"); + warn_once("ClockedObject: Already in the requested power state, " \ + "request ignored"); return; } -- 2.30.2