Skip to contentSkip to conversation

hw/block/tc58128: Don't emit deprecation warning under qtest

PATCH In review Peter Maydell 2 participants 3 messages Feb 6, 2024 – Feb 13, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/block/tc58128: Don't emit deprecation warning under qtest

Suppress the deprecation warning when we're running under qtest, to avoid "make check" including warning messages in its output.

---
 hw/block/tc58128.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/block/tc58128.c +3 -1
index 6944cf58fa4..0984e37417b 100644
@@ -202,7 +202,9 @@ static sh7750_io_device tc58128 = {
 
 int tc58128_init(struct SH7750State *s, const char *zone1, const char *zone2)
 {
-    warn_report_once("The TC58128 flash device is deprecated");
+    if (!qtest_enabled()) {
+        warn_report_once("The TC58128 flash device is deprecated");
+    }
     init_dev(&tc58128_devs[0], zone1);
     init_dev(&tc58128_devs[1], zone2);
     return sh7750_register_io_device(s, &tc58128);
Signature · 1 line
2.34.1