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

Peter Maydell posted 1 patch 9 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240206154151.155620-1-peter.maydell@linaro.org
Maintainers: Yoshinori Sato <ysato@users.sourceforge.jp>, Magnus Damm <magnus.damm@gmail.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
hw/block/tc58128.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH] hw/block/tc58128: Don't emit deprecation warning under qtest
Posted by Peter Maydell 9 months, 3 weeks ago
Suppress the deprecation warning when we're running under qtest,
to avoid "make check" including warning messages in its output.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/block/tc58128.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c
index 6944cf58fa4..0984e37417b 100644
--- a/hw/block/tc58128.c
+++ b/hw/block/tc58128.c
@@ -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);
-- 
2.34.1
Re: [PATCH] hw/block/tc58128: Don't emit deprecation warning under qtest
Posted by Philippe Mathieu-Daudé 9 months, 2 weeks ago
On 6/2/24 16:41, Peter Maydell wrote:
> Suppress the deprecation warning when we're running under qtest,
> to avoid "make check" including warning messages in its output.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   hw/block/tc58128.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Patched queued, thanks.
Re: [PATCH] hw/block/tc58128: Don't emit deprecation warning under qtest
Posted by Philippe Mathieu-Daudé 9 months, 3 weeks ago
On 6/2/24 16:41, Peter Maydell wrote:
> Suppress the deprecation warning when we're running under qtest,
> to avoid "make check" including warning messages in its output.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   hw/block/tc58128.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>