Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44AF16071A3B for ; Wed, 4 Nov 2026 20:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NtRPeRQG Received: from list by lists.xenproject.org with outflank-mailman.1472511.1680335 (Exim 4.92) (envelope-from ) id 1xOhR3-0006l2-Fq; Wed, 04 Nov 2026 20:18:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1472511.1680335; Wed, 04 Nov 2026 20:18:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xOhR3-0006kr-Ao; Wed, 04 Nov 2026 20:18:17 +0000 Received: by outflank-mailman (input) for mailman id 1472511; Wed, 04 Nov 2026 20:18:16 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xOhR2-0006kl-GI for xen-devel@lists.xenproject.org; Wed, 04 Nov 2026 20:18:16 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xOhR1-00FVKT-TK for xen-devel@lists.xenproject.org; Wed, 04 Nov 2026 21:18:15 +0100 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6aeb92cc-bab6-0a2a0a5309dd-0a2a45019152-42 for ; Wed, 04 Nov 2026 21:18:15 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6aeb9306-5984-0a2a45010019-aa0a817c8983-3 for ; Wed, 04 Nov 2026 21:18:15 +0100 Received: from mx-prod-mc-03.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-581-UbiHqfl6O8qu1UKLLUissw-1; Wed, 04 Nov 2026 15:18:12 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 13EDA1955DD6; Wed, 4 Nov 2026 20:18:09 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0186139206; Wed, 4 Nov 2026 20:18:07 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Post: List-Help: List-Subscribe: , Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793823493; 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=jKP5HFz810ebf9alfWmuhAqqhtocmxxt5vjo0KJQomg=; b=NtRPeRQGbAQIudRlFmTmh46UJ6Lz9EYgYUbWBgIhpYpC9Td/t77bRlYfJVRmSXmVT6exIO dJPGBDgFhL+6Vfj0+HWRJ0qfcTMXT7vJMlmH5NB4eG2OyrSAlfNWTwd+lBCUQkb5EshDmJ yW07FIUTZPpfEenQsv3xWXn4UyBtfN4= X-MC-Unique: UbiHqfl6O8qu1UKLLUissw-1 X-Mimecast-MFC-AGG-ID: UbiHqfl6O8qu1UKLLUissw_1793823489 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Gerd Hoffmann , xen-devel@lists.xenproject.org, qemu-ppc@nongnu.org, "Edgar E. Iglesias" , Eric Blake , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , Helge Deller , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL v2 02/25] trace: use 'ignore_value()' instead of a dummy variable Date: Wed, 4 Nov 2026 15:17:38 -0500 Message-ID: <20261104201802.11556-3-stefanha@redhat.com> In-Reply-To: <20261104201802.11556-1-stefanha@redhat.com> References: <20261104201802.11556-1-stefanha@redhat.com> X-Archived-By: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: _KbILR3izsUpT4IbHrYUAjGQl6aVXuCmP9jWhRuq-cQ_1793823489 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-d62444/1793823495-BE664757-F6DAF0A9/35/111497 X-purgate-type: clean X-purgate-size: 2669 X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Daniel P. Berrangé This pattern is more concise than using a dummy variable which in turn needs annotating as unused. Reviewed-by: Marc-André Lureau Signed-off-by: Daniel P. Berrangé Message-id: 20261102142844.3464712-3-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- trace/ftrace.c | 3 +-- trace/simple.c | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/trace/ftrace.c b/trace/ftrace.c index 6875faedb9c..c1ed6ad4454 100644 --- a/trace/ftrace.c +++ b/trace/ftrace.c @@ -41,7 +41,6 @@ static int find_mount(char *mount_point, const char *fstype) void ftrace_write(const char *fmt, ...) { char ftrace_buf[MAX_TRACE_STRLEN]; - int unused __attribute__ ((unused)); int trlen; va_list ap; @@ -50,7 +49,7 @@ void ftrace_write(const char *fmt, ...) va_end(ap); trlen = MIN(trlen, MAX_TRACE_STRLEN - 1); - unused = write(trace_marker_fd, ftrace_buf, trlen); + ignore_value(write(trace_marker_fd, ftrace_buf, trlen)); } bool ftrace_init(void) diff --git a/trace/simple.c b/trace/simple.c index c0aba00cb7f..e148ca44530 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -163,7 +163,6 @@ static gpointer writeout_thread(gpointer opaque) } dropped; unsigned int idx = 0; int dropped_count; - size_t unused __attribute__ ((unused)); uint64_t type = TRACE_RECORD_TYPE_EVENT; for (;;) { @@ -179,13 +178,13 @@ static gpointer writeout_thread(gpointer opaque) } while (!g_atomic_int_compare_and_exchange(&dropped_events, dropped_count, 0)); dropped.rec.arguments[0] = dropped_count; - unused = fwrite(&type, sizeof(type), 1, trace_fp); - unused = fwrite(&dropped.rec, dropped.rec.length, 1, trace_fp); + ignore_value(fwrite(&type, sizeof(type), 1, trace_fp)); + ignore_value(fwrite(&dropped.rec, dropped.rec.length, 1, trace_fp)); } while (get_trace_record(idx, &recordptr)) { - unused = fwrite(&type, sizeof(type), 1, trace_fp); - unused = fwrite(recordptr, recordptr->length, 1, trace_fp); + ignore_value(fwrite(&type, sizeof(type), 1, trace_fp)); + ignore_value(fwrite(recordptr, recordptr->length, 1, trace_fp)); writeout_idx += recordptr->length; free(recordptr); /* don't use g_free, can deadlock when traced */ idx = writeout_idx % TRACE_BUF_LEN; -- 2.56.0