From nobody Sun Jan 25 12:00:39 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769154656; cv=none; d=zohomail.com; s=zohoarc; b=Xfxn6kUWQc93LKAVmDQIWEa/xQ79bBzOio8aLUmhTVRAGcHKgkOIzYF2MUoH0lNoKrUDq2ttIjFoxytvvoTDshS3ZxeIp9fCMtM2gGlvLS15ALK7Bfy2VtDP4++pOLyZLJ6uK1VRHfhT1feKYzf2fUSH4fhTyBTJbEMPdq8al2Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769154656; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+Cj/bw4qDmmlXzoSIRtDAt+6VfD0KQ8QNUsb/YNDCvQ=; b=ka0rrVb//LpBe4q6o/RSjAcO/WUysbVCVXS/kwpy72oyHtsNMMhSgTaO3v7ft89ZUVuBasEcm0N5KWIQppjv87KzkaA3axgmCK+oi+dfhIBJOV5YrohFUA8MGat2DgwMZyAlqqM7TRHtQhw249KCcvSBp/HxhsFMbCyySw3EVk8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769154656314471.54979629495585; Thu, 22 Jan 2026 23:50:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vjBw5-0002oI-C6; Fri, 23 Jan 2026 02:50:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vjBvk-0002fR-1u for qemu-devel@nongnu.org; Fri, 23 Jan 2026 02:50:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vjBvg-000217-LA for qemu-devel@nongnu.org; Fri, 23 Jan 2026 02:50:07 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-ImBu0YZpNWODDp4RgMSgRA-1; Fri, 23 Jan 2026 02:49:59 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 94D8719775A7; Fri, 23 Jan 2026 07:49:58 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1654E1956095; Fri, 23 Jan 2026 07:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769154603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Cj/bw4qDmmlXzoSIRtDAt+6VfD0KQ8QNUsb/YNDCvQ=; b=TWi7Du29dVXK/kVPe2zf7DtPfk4TOBa4CsGdU/XdLXFmW2NcxN13359G3W8G1408iW37VO q0Rv0ogwsSnrt1GtSjw6yRxsBIslcQBlre1Xl9YyPzcyAq7WYnFNSWXa6v+b0qySX+HO0p JjAsiheCFmpcgPisLvf6lazZZpAZPGE= X-MC-Unique: ImBu0YZpNWODDp4RgMSgRA-1 X-Mimecast-MFC-AGG-ID: ImBu0YZpNWODDp4RgMSgRA_1769154598 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eduardo Habkost Subject: [PATCH 01/37] audio: remove obsolete/obscure functions Date: Fri, 23 Jan 2026 11:49:04 +0400 Message-ID: <20260123074945.2563196-2-marcandre.lureau@redhat.com> In-Reply-To: <20260123074945.2563196-1-marcandre.lureau@redhat.com> References: <20260123074945.2563196-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.07, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769154659030154100 From: Marc-Andr=C3=A9 Lureau AUD_init_time_stamp_{in,out} and AUD_get_elapsed_usec_{in,out} are only used by the adlib device. The result isn't actually being used since ADLIB_KILL_TIMERS was set some 20y ago. Let's drop this dead code now. Drop QEMUAudioTimeStamp as well as reported by Akihiko Odaki. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio_template.h | 34 ------------------- include/qemu/audio.h | 10 ------ hw/audio/adlib.c | 18 +--------- .../codeconverter/test_regexps.py | 1 - 4 files changed, 1 insertion(+), 62 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index 7a8c431f2d7..1ab3c47fd76 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -569,40 +569,6 @@ bool glue(AUD_is_active_, TYPE)(SW *sw) return sw ? sw->active : 0; } =20 -void glue (AUD_init_time_stamp_, TYPE) (SW *sw, QEMUAudioTimeStamp *ts) -{ - if (!sw) { - return; - } - - ts->old_ts =3D sw->hw->ts_helper; -} - -uint64_t glue (AUD_get_elapsed_usec_, TYPE) (SW *sw, QEMUAudioTimeStamp *t= s) -{ - uint64_t delta, cur_ts, old_ts; - - if (!sw) { - return 0; - } - - cur_ts =3D sw->hw->ts_helper; - old_ts =3D ts->old_ts; - /* dolog ("cur %" PRId64 " old %" PRId64 "\n", cur_ts, old_ts); */ - - if (cur_ts >=3D old_ts) { - delta =3D cur_ts - old_ts; - } else { - delta =3D UINT64_MAX - old_ts + cur_ts; - } - - if (!delta) { - return 0; - } - - return muldiv64 (delta, sw->hw->info.freq, 1000000); -} - #undef TYPE #undef HW #undef SW diff --git a/include/qemu/audio.h b/include/qemu/audio.h index a92e0b70ef0..a1a64ad340d 100644 --- a/include/qemu/audio.h +++ b/include/qemu/audio.h @@ -50,10 +50,6 @@ struct AudioBackendClass { =20 typedef struct AudioBackend AudioBackend; =20 -typedef struct QEMUAudioTimeStamp { - uint64_t old_ts; -} QEMUAudioTimeStamp; - bool AUD_backend_check(AudioBackend **be, Error **errp); =20 SWVoiceOut *AUD_open_out ( @@ -71,9 +67,6 @@ int AUD_get_buffer_size_out (SWVoiceOut *sw); void AUD_set_active_out(SWVoiceOut *sw, bool on); bool AUD_is_active_out(SWVoiceOut *sw); =20 -void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts); -uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts); - #define AUDIO_MAX_CHANNELS 16 typedef struct Volume { bool mute; @@ -112,9 +105,6 @@ size_t AUD_read (SWVoiceIn *sw, void *pcm_buf, size_t s= ize); void AUD_set_active_in(SWVoiceIn *sw, bool on); bool AUD_is_active_in(SWVoiceIn *sw); =20 -void AUD_init_time_stamp_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts); -uint64_t AUD_get_elapsed_usec_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts); - void audio_cleanup(void); =20 typedef struct st_sample st_sample; diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 8b9fe53e17b..efab5107a4c 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -34,8 +34,6 @@ =20 #define DEBUG 0 =20 -#define ADLIB_KILL_TIMERS 1 - #define ADLIB_DESC "Yamaha YM3812 (OPL2)" =20 #if DEBUG @@ -71,7 +69,6 @@ struct AdlibState { uint64_t dexp[2]; SWVoiceOut *voice; int left, pos, samples; - QEMUAudioTimeStamp ats; FM_OPL *opl; PortioList port_list; }; @@ -88,19 +85,7 @@ static void adlib_kill_timers (AdlibState *s) =20 for (i =3D 0; i < 2; ++i) { if (s->ticking[i]) { - uint64_t delta; - - delta =3D AUD_get_elapsed_usec_out (s->voice, &s->ats); - ldebug ( - "delta =3D %f dexp =3D %f expired =3D> %d", - delta / 1000000.0, - s->dexp[i] / 1000000.0, - delta >=3D s->dexp[i] - ); - if (ADLIB_KILL_TIMERS || delta >=3D s->dexp[i]) { - adlib_stop_opl_timer (s, i); - AUD_init_time_stamp_out (s->voice, &s->ats); - } + adlib_stop_opl_timer(s, i); } } } @@ -149,7 +134,6 @@ static void timer_handler (void *opaque, int c, double = interval_Sec) #endif =20 s->dexp[n] =3D interval_Sec * 1000000.0; - AUD_init_time_stamp_out (s->voice, &s->ats); } =20 static int write_audio (AdlibState *s, int samples) diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/= codeconverter/codeconverter/test_regexps.py index b00e9ef15b2..1ab3fa1699f 100644 --- a/scripts/codeconverter/codeconverter/test_regexps.py +++ b/scripts/codeconverter/codeconverter/test_regexps.py @@ -202,7 +202,6 @@ def test_struct_re(): uint64_t dexp[2]; SWVoiceOut *voice; int left, pos, samples; - QEMUAudioTimeStamp ats; FM_OPL *opl; PortioList port_list; } AdlibState; --=20 2.52.0