From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183246; cv=none; d=zohomail.com; s=zohoarc; b=c2Z5SlNLmolYCiH7NL1vkijXJx9VGJFnBaNRLWunC5aLcBGLbMBITZWeRJfEqZeKaROBddT1Q9/JqeH7O7x8evGl/KgKVGSy3D4HO6AYwh0wHwxHqK0S1P/Bn6MuaJhTo0HOhHSmi90e9Db0/N7vZJZflCu6LjLdl1P2qM5Y2ec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183246; 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=uhM4mUe4SOwd5IXKZy3s8JqZaDqEwhiZJ//8HTUJpqA=; b=GPtsI0fcOysEViWdxOKq/4xwmEpO0sDhaBQqesaL59+q5fS2gwhSaO57ycSajEq4wUmgdKh4ljeZSh1gzygIbMaVJ7YvvkQqZOLo9QG9Xh+klOSs8VYpCQpCp1RYWRe4pKLxvg8iVOXxRFtJd9VmhLSp9oOx6sWewBHWqby1D74= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183246621686.5090609563546; Tue, 24 Sep 2024 06:07:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5FH-0006XO-0N; Tue, 24 Sep 2024 09:06:28 -0400 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 1st5F9-00067u-LO for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:15 -0400 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 1st5F8-0000Qy-3q for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:15 -0400 Received: from mx-prod-mc-01.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-452-o1guDNIbMbKakirVwPuRew-1; Tue, 24 Sep 2024 09:06:08 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7518B19772C0; Tue, 24 Sep 2024 13:06:05 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9E8511956048; Tue, 24 Sep 2024 13:06:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183173; 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=uhM4mUe4SOwd5IXKZy3s8JqZaDqEwhiZJ//8HTUJpqA=; b=L6XL5KU2kJUOVlzEqzIFUhOVROzWWvano+6c/uI593lQS/r2vvfNRNBqZgrcdLdrDJ3tlZ Ye4o05kNudCc7PMVwatrqxSCp+8qdCUjoJTvjm9svTOIEoAOkSyrJFh+RtTwtcLVU4cLrP l1dEney3GdODaz10ZfDjqYm52cMz41o= X-MC-Unique: o1guDNIbMbKakirVwPuRew-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 01/22] util/coroutine: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:32 +0400 Message-ID: <20240924130554.749278-2-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183262608116600 From: Marc-Andr=C3=A9 Lureau ../util/qemu-coroutine.c:150:8: error: =E2=80=98batch=E2=80=99 may be used = uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Hajnoczi --- util/qemu-coroutine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c index eb4eebefdf..64d6264fc7 100644 --- a/util/qemu-coroutine.c +++ b/util/qemu-coroutine.c @@ -136,7 +136,7 @@ static Coroutine *coroutine_pool_get_local(void) static void coroutine_pool_refill_local(void) { CoroutinePool *local_pool =3D get_ptr_local_pool(); - CoroutinePoolBatch *batch; + CoroutinePoolBatch *batch =3D NULL; =20 WITH_QEMU_LOCK_GUARD(&global_pool_lock) { batch =3D QSLIST_FIRST(&global_pool); --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183268; cv=none; d=zohomail.com; s=zohoarc; b=T0nEPXyYGGuDWsf5y33gLOiZ4enIbZejz7EmgLHwkr7ucru4zqtQIjtsqCezrnC41FL8Iq7LxMs+YFGkDMjfGiY0/ZWoNFTTXN4KPPfdR7Au4wBZGCz03kY0IEU4ciNQBLHKes2NwhEuPQYSyR2g3Jqwt/Sg0l9G4OysZUzG6w0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183268; 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=juoBgupwWMoqhWmjH7vChMoVIcRlJCGErn3vcRAITy4=; b=iqSD7iC90x3ueOKEx8Yof/EFqRI+qglAt3SOCDZvE+0+bUIo02N0uPsm/JhNiDM4quD3v/u2dNgUosEwne2Q6iEZgafpqOjORyxFUAZmpXmXEOIcxHqUorW4VBvaTKMfeTjvlghRyB01pQxIFbUC9TVosTrL1I/8TXLmKasO9gU= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183268610559.5632195149959; Tue, 24 Sep 2024 06:07:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5FZ-00085O-AN; Tue, 24 Sep 2024 09:06:41 -0400 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 1st5FC-0006Sa-Sq for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5FA-0000RM-T3 for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:18 -0400 Received: from mx-prod-mc-04.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-175-dDU3-l5jOiWcQ0VgRnqZ0Q-1; Tue, 24 Sep 2024 09:06:12 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 04F3B18DB8CE; Tue, 24 Sep 2024 13:06:10 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E53E01956054; Tue, 24 Sep 2024 13:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183176; 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=juoBgupwWMoqhWmjH7vChMoVIcRlJCGErn3vcRAITy4=; b=gxPmpS96o9H7ubJO1cGeKsXLc/0lEAZ2thxmSOP8fV9EJ9sdfSkvzdqWPmBELVgbSW55Ed 0jsxFceyFYPek/ImV+8FhdP43Tdu2vZTM3l1KA0x91JF5JxtG7NsujUbyClR/aIlXtsif4 K0tDXGfEmGYiT+OfV16+xMg4XHoHE58= X-MC-Unique: dDU3-l5jOiWcQ0VgRnqZ0Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 02/22] util/timer: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:33 +0400 Message-ID: <20240924130554.749278-3-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.40 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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183269711116600 From: Marc-Andr=C3=A9 Lureau ../util/qemu-timer.c:198:24: error: =E2=80=98expire_time=E2=80=99 may be us= ed uninitialized [-Werror=3Dmaybe-uninitialized] ../util/qemu-timer.c:476:8: error: =E2=80=98rearm=E2=80=99 may be used unin= itialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Manos Pitsidianakis --- util/qemu-timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/qemu-timer.c b/util/qemu-timer.c index 213114be68..c948cb1b72 100644 --- a/util/qemu-timer.c +++ b/util/qemu-timer.c @@ -182,7 +182,7 @@ bool qemu_clock_has_timers(QEMUClockType type) =20 bool timerlist_expired(QEMUTimerList *timer_list) { - int64_t expire_time; + int64_t expire_time =3D 0; =20 if (!qatomic_read(&timer_list->active_timers)) { return false; @@ -212,7 +212,7 @@ bool qemu_clock_expired(QEMUClockType type) int64_t timerlist_deadline_ns(QEMUTimerList *timer_list) { int64_t delta; - int64_t expire_time; + int64_t expire_time =3D 0; =20 if (!qatomic_read(&timer_list->active_timers)) { return -1; @@ -461,7 +461,7 @@ void timer_mod_ns(QEMUTimer *ts, int64_t expire_time) void timer_mod_anticipate_ns(QEMUTimer *ts, int64_t expire_time) { QEMUTimerList *timer_list =3D ts->timer_list; - bool rearm; + bool rearm =3D false; =20 WITH_QEMU_LOCK_GUARD(&timer_list->active_timers_lock) { if (ts->expire_time =3D=3D -1 || ts->expire_time > expire_time) { --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183270; cv=none; d=zohomail.com; s=zohoarc; b=IDBsgs2WR3asHFxhtXqFvNBhYVsvhffMZvquZGy2iTz9kXQ47b0mpRMBv8X1fnRhfA+QvCW0SFarjqpffsCXIKrAYKtVm4gyIsxlOSjDWf/BxZlKWt7lD65z3xwHzyKXNGewXPS+TzV18qusl43F30Xpl4OQWlZBznJUyuU0DPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183270; 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=L9TzJiPbue6ZM4XJgTlzabYUdWmkITNbnAqP3qVgNyk=; b=Oy4c1L4kVNS9hNx6glecjzSVCAlIK/spnKuWBlNbdUQg6imwNINqFD0wnKhGTEKB2AaWOIKdCl4/FBadvh5otvUzdUHy+1DckY6S4/zLxAWfFprcqCdpE2cnrwrC1BSFuPKCEmJYOlmRPS39vZPOf/4xBA+4DSbwYVbDlLE6hs4= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183270068828.6901937621744; Tue, 24 Sep 2024 06:07:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Fb-0008To-MU; Tue, 24 Sep 2024 09:06:44 -0400 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 1st5FK-000726-Tl for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:28 -0400 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 1st5FH-0000SA-AI for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:25 -0400 Received: from mx-prod-mc-04.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-318-NQx5MvfZOW66ey0QXVU29A-1; Tue, 24 Sep 2024 09:06:19 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 82FD118DB8E4; Tue, 24 Sep 2024 13:06:15 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9A71519560AA; Tue, 24 Sep 2024 13:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183182; 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=L9TzJiPbue6ZM4XJgTlzabYUdWmkITNbnAqP3qVgNyk=; b=SWbc2m9/1SQ2atuO2eWGLOsVnaJTrU79xeD0h+5S8O9Jk5ulVniXUUt6qtGgLcbS4iyKGT r0lH5UhT6AuL+U8YHIqdi7gMg/RGJS8OBhSPzsH92eNrg2XDPgBuUQQbglANIJ9qtambRz ySpPQvuHudKtbZb4vF6PPP4RReUCAn4= X-MC-Unique: NQx5MvfZOW66ey0QXVU29A-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 03/22] hw/qxl: fix -Werror=maybe-uninitialized false-positives Date: Tue, 24 Sep 2024 17:05:34 +0400 Message-ID: <20240924130554.749278-4-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183271579116600 From: Marc-Andr=C3=A9 Lureau ../hw/display/qxl.c:1352:5: error: =E2=80=98pci_region=E2=80=99 may be used= uninitialized [-Werror=3Dmaybe-uninitialized] ../hw/display/qxl.c:1365:22: error: =E2=80=98pci_start=E2=80=99 may be used= uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Manos Pitsidianakis --- hw/display/qxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 3c2b5182ca..20e13ee98d 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1301,8 +1301,8 @@ static int qxl_add_memslot(PCIQXLDevice *d, uint32_t = slot_id, uint64_t delta, }; uint64_t guest_start; uint64_t guest_end; - int pci_region; - pcibus_t pci_start; + int pci_region =3D -1; + pcibus_t pci_start =3D -1; pcibus_t pci_end; MemoryRegion *mr; intptr_t virt_start; --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183249; cv=none; d=zohomail.com; s=zohoarc; b=R1zPoF8CbqYmDoEks6itcSq6GGqV0ZABGAuEBJfxKXCxUwOaK86th9kFsPVZwJZTFMq7USB6XGVrW953REK6AkC4XQJvhDz4iyFAxu6xGAEVsmfjeaqaemFvPnmOx0a4xlJNuPQitzVTqcf38YBuuAmkY87nN7mk4RLo7DvKyHU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183249; 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=JGOe2Dnp1wJG1ukQSWN3HzZdCz5Em4HGNnPdjOs5MqI=; b=dOOcgDM1PMaLWRlXuvW8b7CVzv1gUx6bKNsPjIYVv7gfY6i9NJi3hIG7+gwKNktCY4bTlYLXZsPFDdPiProZLFYoeSUbkYdpjCf87OTU0Xfrj9ME16V4yYYhRT1CxNeS+ORfKjEWjY/6j/fvXpzKs4dgzi/wDe9rK+8sUIzGQnA= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183249035198.1624813698029; Tue, 24 Sep 2024 06:07:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5GG-0003MI-43; Tue, 24 Sep 2024 09:07:25 -0400 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 1st5FQ-0007Ri-Mo for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5FL-0000SZ-TR for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:29 -0400 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-517-KiF6AAusOZys16h76pkVMw-1; Tue, 24 Sep 2024 09:06:24 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (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 3B53518E6E3F; Tue, 24 Sep 2024 13:06:20 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0139119560AD; Tue, 24 Sep 2024 13:06:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183187; 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=JGOe2Dnp1wJG1ukQSWN3HzZdCz5Em4HGNnPdjOs5MqI=; b=jL3ESGwRkWnrfyqw4izVmZvZPh1XDdEjqenYIGUA4HXUe55riR1hD8hvcvacz+2LFgCKEj yDooY6tfFvCw24YA1gjVMpLhXrSQu3QwlgiaoNaGrYFAAwI0gTMtaYOCV+m2seJH2dY9VE mgu59kLO9LsFRMXLRuDD/UORDNkE9FU= X-MC-Unique: KiF6AAusOZys16h76pkVMw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 04/22] nbd: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:35 +0400 Message-ID: <20240924130554.749278-5-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.12 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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183262608116601 From: Marc-Andr=C3=A9 Lureau ../nbd/client-connection.c:419:8: error: =E2=80=98wait_co=E2=80=99 may be u= sed uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake --- nbd/client-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbd/client-connection.c b/nbd/client-connection.c index f9da67c87e..b11e266807 100644 --- a/nbd/client-connection.c +++ b/nbd/client-connection.c @@ -410,7 +410,7 @@ nbd_co_establish_connection(NBDClientConnection *conn, = NBDExportInfo *info, */ void nbd_co_establish_connection_cancel(NBDClientConnection *conn) { - Coroutine *wait_co; + Coroutine *wait_co =3D NULL; =20 WITH_QEMU_LOCK_GUARD(&conn->mutex) { wait_co =3D g_steal_pointer(&conn->wait_co); --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183324; cv=none; d=zohomail.com; s=zohoarc; b=em5bkamcnsF3/Pb0p/Ci9NL7d9VeSOA+1F1dtxh2yG8foMOxyWw6oghD7Zv8tkKA8mBZ1pxLGrLDGHiX5LeSZmwDyQ18jal8RlRSCNGePOg3+FsLKzcH4EAPHOCUFrSwwLFVN7MRpNhQP3q6mdWBzDHbxOARAS/I90QNIXaH32U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183324; 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=foZ7CWBn2Ic+QnOUkHIFPNTfKtf84lHEG4IMdgmc9Bo=; b=f07RzD6EwN1dqyYzIYkmiI0LuuOA3CWDmu5hdS2oN5xwDbK9+Efs8KhfV0ePtUPe8kZ8KtDhlknr2bJ9QJ6KyRHKyFH9DFbYMmKYQfoqiqtZDflvQTe74hZp/on2QVOoYLCZ7Xe0N7l9gbE60Jc8veUCX+E5lILfRxIxXAzIniA= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183324653419.39084334443635; Tue, 24 Sep 2024 06:08:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5GF-0003Kf-Id; Tue, 24 Sep 2024 09:07:25 -0400 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 1st5FT-0007h4-1D for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5FQ-0000T0-FH for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:33 -0400 Received: from mx-prod-mc-04.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-629-4UAApZFtNe-VxrIXGEBZMw-1; Tue, 24 Sep 2024 09:06:28 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B00A71902FF4; Tue, 24 Sep 2024 13:06:25 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C702E19560AA; Tue, 24 Sep 2024 13:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183191; 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=foZ7CWBn2Ic+QnOUkHIFPNTfKtf84lHEG4IMdgmc9Bo=; b=J8bUz9uxcSUm78bnX3IfTD7QWInCuqqszx5zah0bKoBUhKfa4f0y0ohVH+5/rQbjIxgORr ttp9YELUVUw0GYQkHo93B2NMR1IjzarPWuP5nFxkm3ny8AUrUBjWkThdGzNGqnfFY6RQou b4Au8rmzRfWG99xXs+CLWgjsNnWtMUI= X-MC-Unique: 4UAApZFtNe-VxrIXGEBZMw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 05/22] block/mirror: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:36 +0400 Message-ID: <20240924130554.749278-6-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.40 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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183326170116600 From: Marc-Andr=C3=A9 Lureau ../block/mirror.c:1066:22: error: =E2=80=98iostatus=E2=80=99 may be used un= initialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/mirror.c b/block/mirror.c index 61f0a717b7..54e3a7ea9d 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -931,7 +931,7 @@ static int coroutine_fn mirror_run(Job *job, Error **er= rp) MirrorBDSOpaque *mirror_top_opaque =3D s->mirror_top_bs->opaque; BlockDriverState *target_bs =3D blk_bs(s->target); bool need_drain =3D true; - BlockDeviceIoStatus iostatus; + BlockDeviceIoStatus iostatus =3D BLOCK_DEVICE_IO_STATUS__MAX; int64_t length; int64_t target_length; BlockDriverInfo bdi; --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183246; cv=none; d=zohomail.com; s=zohoarc; b=NBg5lK6YWo5JoZ321LRE0rjR3scJ66tiw6ENKQvCCl3BCRlI7OIrdpVtRb2WkU37cuUEXvmQxIx1QiI6C2Eh0gHUqfF6Z0tx7B9Y3ZRqzUVwGv35E9UfZMJXG3PxSjnsB80Ty96RRTXjDP4hckrKNRllIGFeXuQ1KBIE/T5CRG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183246; 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=lM3KpPrye86/Cu4EqGuleHP2TkpZj/gEzbpsHn25xPs=; b=lX3cDn3l50wSkyMACZHlWE9B4fhi2tgZ5Sy848P54T8TuTd5MxqpG3OIwO4MnqWTeYHnFmEvoWMWGjddMi5+5A47Q+uKH8IIR6TdfQ9Nuz38kklv5VLZFI3yS8fg0bzsLEE/C+C8OY8WytpjIwg+A45ZtXDTJUGFccq+o2JvP20= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183246629507.21292063025385; Tue, 24 Sep 2024 06:07:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5G0-0001HX-H2; Tue, 24 Sep 2024 09:07:12 -0400 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 1st5FY-0008Fk-Ro for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:41 -0400 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 1st5FX-0000U1-7q for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:40 -0400 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-372-aogsTG9rN4mymFWT5uF2aQ-1; Tue, 24 Sep 2024 09:06:34 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [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 61F0918E6E3F; Tue, 24 Sep 2024 13:06:31 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5122F1956048; Tue, 24 Sep 2024 13:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183198; 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=lM3KpPrye86/Cu4EqGuleHP2TkpZj/gEzbpsHn25xPs=; b=eURLnsqnloCeF3iip4dQB4psfc2Xou0GXHxwS+grTX2kFJqFzKmZZtUMiXIriiRaRiw537 nvbtAfDmU28aSfvbYVx/mHj2+brcPmOmdAzsHwmLjKwd1bVSXO/r78x7nHEqszYwXYq29K 7RoqE5PI8BM6jR+T/GBLtrGYzamqLmY= X-MC-Unique: aogsTG9rN4mymFWT5uF2aQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 06/22] block/mirror: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:37 +0400 Message-ID: <20240924130554.749278-7-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183247840116600 From: Marc-Andr=C3=A9 Lureau ../block/mirror.c:404:5: error: =E2=80=98ret=E2=80=99 may be used uninitial= ized [-Werror=3Dmaybe-uninitialized] ../block/mirror.c:895:12: error: =E2=80=98ret=E2=80=99 may be used uninitia= lized [-Werror=3Dmaybe-uninitialized] ../block/mirror.c:578:12: error: =E2=80=98ret=E2=80=99 may be used uninitia= lized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- block/mirror.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 54e3a7ea9d..fd55a580fb 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -349,7 +349,7 @@ static void coroutine_fn mirror_co_read(void *opaque) MirrorOp *op =3D opaque; MirrorBlockJob *s =3D op->s; int nb_chunks; - uint64_t ret; + uint64_t ret =3D -1; uint64_t max_bytes; =20 max_bytes =3D s->granularity * s->max_iov; @@ -565,7 +565,7 @@ static void coroutine_fn GRAPH_UNLOCKED mirror_iteratio= n(MirrorBlockJob *s) =20 bitmap_set(s->in_flight_bitmap, offset / s->granularity, nb_chunks); while (nb_chunks > 0 && offset < s->bdev_length) { - int ret; + int ret =3D -1; int64_t io_bytes; int64_t io_bytes_acct; MirrorMethod mirror_method =3D MIRROR_METHOD_COPY; @@ -841,7 +841,7 @@ static int coroutine_fn GRAPH_UNLOCKED mirror_dirty_ini= t(MirrorBlockJob *s) int64_t offset; BlockDriverState *bs; BlockDriverState *target_bs =3D blk_bs(s->target); - int ret; + int ret =3D -1; int64_t count; =20 bdrv_graph_co_rdlock(); --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183515; cv=none; d=zohomail.com; s=zohoarc; b=icduB3ao2bpcFDdB1Yta8QNRnsBXuiaeafaAtCWhXkygW43eGBDBkzKp/ehAnTKENnN/EIpbqzH9x6KKmvz6fSAEGckXc1vSZIXd+YV+2YSgIk8aSY3Hp188bDRtNZsktCgyB/4zRzRzIJ3KLfPubhpnNeObMFIdQRMTl/qLabQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183515; 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=T0MLcA6aNzv2RR1lKUo89sny5RQMOplmDT7BSRDnP8M=; b=MYsMTIxWQWsvRd3APbQ43WoZizgDeIqHDcLBZvhWGW0kkcfQVBVlO21qg/tWYHrSMS/bQGulIdcgrNF902QkNY6J1v2bEJ48UuKzzMoCoAi1Vog1EfTkVO2xkis1IgwplXPIhoIS058ta6vqFugoFBk4E+uMSh24gZg/rZmVQok= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183515274412.1324576878743; Tue, 24 Sep 2024 06:11:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Gk-0005tU-12; Tue, 24 Sep 2024 09:07:57 -0400 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 1st5Fl-00013a-8h for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5Fh-0000WH-Rz for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:53 -0400 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-5-I4TH7hFOOxaQSTYEdX2Aag-1; Tue, 24 Sep 2024 09:06:46 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.4]) (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 AF5BF1896E3D; Tue, 24 Sep 2024 13:06:36 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D7C3F30001A1; Tue, 24 Sep 2024 13:06:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183208; 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=T0MLcA6aNzv2RR1lKUo89sny5RQMOplmDT7BSRDnP8M=; b=jMaE/nD7q0ba3cD6eGCFYbf9wkv+fGZfMF0DoK1yBDxFVYIt7AjehfXy0veR8i3V5Mr7SZ ls3yOA3jcvr50Zwr4NHJFojaCMSeDoLbgi+n2kzbDRri2AtVeF9bLcDQVmuSzwK9OcQhUP 4L4podrQLQ8Y/N7YwvGFktDcjC9Nj1E= X-MC-Unique: I4TH7hFOOxaQSTYEdX2Aag-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 07/22] block/stream: fix -Werror=maybe-uninitialized false-positives Date: Tue, 24 Sep 2024 17:05:38 +0400 Message-ID: <20240924130554.749278-8-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.4.1 on 10.30.177.4 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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183516499116600 From: Marc-Andr=C3=A9 Lureau ../block/stream.c:193:19: error: =E2=80=98unfiltered_bs=E2=80=99 may be use= d uninitialized [-Werror=3Dmaybe-uninitialized] ../block/stream.c:176:5: error: =E2=80=98len=E2=80=99 may be used uninitial= ized [-Werror=3Dmaybe-uninitialized] trace/trace-block.h:906:9: error: =E2=80=98ret=E2=80=99 may be used uniniti= alized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Manos Pitsidianakis --- block/stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/stream.c b/block/stream.c index 7031eef12b..9076203193 100644 --- a/block/stream.c +++ b/block/stream.c @@ -155,8 +155,8 @@ static void stream_clean(Job *job) static int coroutine_fn stream_run(Job *job, Error **errp) { StreamBlockJob *s =3D container_of(job, StreamBlockJob, common.job); - BlockDriverState *unfiltered_bs; - int64_t len; + BlockDriverState *unfiltered_bs =3D NULL; + int64_t len =3D -1; int64_t offset =3D 0; int error =3D 0; int64_t n =3D 0; /* bytes */ @@ -177,7 +177,7 @@ static int coroutine_fn stream_run(Job *job, Error **er= rp) =20 for ( ; offset < len; offset +=3D n) { bool copy; - int ret; + int ret =3D -1; =20 /* Note that even when no rate limit is applied we need to yield * with no pending I/O here so that bdrv_drain_all() returns. --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183270; cv=none; d=zohomail.com; s=zohoarc; b=cJrNzH4S6Up7hgUUaWW5qsfnYduc8D15Gbepyr8b1tbGk65SliJeDktUrBvNqPYcpOBxDdjMzbaikrTDZZPeJ6mqBLDe+FwzuZ0Am+AEQQfO2XnwV5RZ5m4VrGoZby5AkWgn/AIdpgom10b9KbnMV0iCEexVnm66KMGUprjLjuY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183270; 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=TbV9ZakF44C4gPu/dzMAxSKaBPNMHPS3TqhrfNh0O0w=; b=T5/rw8k3+OfRIdnE/kaHeRpAPuyBwgtVH+VD0uf4AsLTeMxV1xsvywQ4YKZfcF4Mj9QUZqrWU38G4Pc7ffIxYK5qdQ2Kmmy0npup4HCfHE0ugnmRFQgwP6n5CD6If4DoMOTPrA9TFydtjvhUTgra1OXv42P7FyUr5gU4zCisixU= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183270068895.1647184216923; Tue, 24 Sep 2024 06:07:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5GO-0003xM-Pb; Tue, 24 Sep 2024 09:07:35 -0400 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 1st5Fg-0000jk-PG for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5Fe-0000Uw-Le for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:06:48 -0400 Received: from mx-prod-mc-01.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-479-Vxpk5B89NYyxmsaFNm6UcA-1; Tue, 24 Sep 2024 09:06:44 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2358719792E0; Tue, 24 Sep 2024 13:06:41 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DA1471956048; Tue, 24 Sep 2024 13:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183206; 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=TbV9ZakF44C4gPu/dzMAxSKaBPNMHPS3TqhrfNh0O0w=; b=aAG/HKNobS47IK5zflA2EI+onT/V1c8+Z1qMn1W5p+uj+JZD3/BC57TRgHdupkI9ELr1cV Y4H00lgYGAQJCluiRqL+bhpb2nzWRBxHQfsmLbHc9Ta8oMfOX9pvj/BjLSheH40qCgsqif fvx0ieS1C17AVb5/q5UUOh9s0RCeXbU= X-MC-Unique: Vxpk5B89NYyxmsaFNm6UcA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 08/22] hw/ahci: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:39 +0400 Message-ID: <20240924130554.749278-9-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183271602116600 From: Marc-Andr=C3=A9 Lureau ../hw/ide/ahci.c:989:58: error: =E2=80=98tbl_entry_size=E2=80=99 may be use= d uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Manos Pitsidianakis --- hw/ide/ahci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 7fc2a08df2..d700986c39 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -948,7 +948,6 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGL= ist *sglist, uint64_t sum =3D 0; int off_idx =3D -1; int64_t off_pos =3D -1; - int tbl_entry_size; IDEBus *bus =3D &ad->port; BusState *qbus =3D BUS(bus); =20 @@ -976,6 +975,8 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGL= ist *sglist, /* Get entries in the PRDT, init a qemu sglist accordingly */ if (prdtl > 0) { AHCI_SG *tbl =3D (AHCI_SG *)prdt; + int tbl_entry_size =3D -1; + sum =3D 0; for (i =3D 0; i < prdtl; i++) { tbl_entry_size =3D prdt_tbl_entry_size(&tbl[i]); --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183252; cv=none; d=zohomail.com; s=zohoarc; b=iO3cg76PNCmlGDTZuK+XJsSeMOetfkVJkaGGRsW1bMHIzSQLnNzh7T62fJWctrwqK3x6rruh9EEBd5ThPYkYgwJ46+vg8mA38ZebLFbEbxSrEzWp4ZYOrwdQL5cJBS6UH1gAeV+f9vgRf7CjGCjHK1UxIsGJXmmgRsObAzvYR/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183252; 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=B+ucgqP3hQbgCJa08uMSdP/HbUHRRexmcehpH46W1TY=; b=bSepB3bfw/4jZ++oFnrGMtp/+cNQ6ztBgsyfIFPkfv/KCuWaoxvFvzgdPnu4xBLKD+oRXTUzFwtAKvo0KzfO94ddfR0SIg9YYcHMFVBCToxMgqRHoBDQZfObtOQJV95ZkkLcRzP5A+cVMBBwzRRUx1AbklgbsElWbN88L9trgqk= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183252564711.4122463249153; Tue, 24 Sep 2024 06:07:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5GF-0003Lz-TN; Tue, 24 Sep 2024 09:07:25 -0400 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 1st5Fz-00027v-Sg for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5Fw-0000YG-WF for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:07 -0400 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-671-04O56AknPxedKabWtkXorA-1; Tue, 24 Sep 2024 09:06:57 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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 63FA91895D70; Tue, 24 Sep 2024 13:06:54 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7EE471954B1C; Tue, 24 Sep 2024 13:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183220; 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=B+ucgqP3hQbgCJa08uMSdP/HbUHRRexmcehpH46W1TY=; b=HuuOg4qIc/CIUqVV3i2aGms1OXvpZhIJgdM0ZGx1TjKo6H0YDnQSd/QlyOYUGeyD3x5/fX RKxaoATLhN48T7+47jHU1DLrAzh5RicE6CAosZiSMJlkGgEcPPdoGkbTDNxD8iFt0h8GvS khYgpMjaY5IJoHAmN8DFvsjFgVvd3Fk= X-MC-Unique: 04O56AknPxedKabWtkXorA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 09/22] hw/vhost-scsi: fix -Werror=maybe-uninitialized Date: Tue, 24 Sep 2024 17:05:40 +0400 Message-ID: <20240924130554.749278-10-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.40 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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183255560116600 From: Marc-Andr=C3=A9 Lureau ../hw/scsi/vhost-scsi.c:173:12: error: =E2=80=98ret=E2=80=99 may be used un= initialized [-Werror=3Dmaybe-uninitialized] It can be reached when num_queues=3D0. It probably doesn't make much sense to instantiate a vhost-scsi with 0 IO queues though. For now, make vhost_scsi_set_workers() return success/0 anyway, when no workers have been setup. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefano Garzarella --- hw/scsi/vhost-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 49cff2a0cb..22d16dc26b 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -172,7 +172,7 @@ static int vhost_scsi_set_workers(VHostSCSICommon *vsc,= bool per_virtqueue) struct vhost_dev *dev =3D &vsc->dev; struct vhost_vring_worker vq_worker; struct vhost_worker_state worker; - int i, ret; + int i, ret =3D 0; =20 /* Use default worker */ if (!per_virtqueue || dev->nvqs =3D=3D VHOST_SCSI_VQ_NUM_FIXED + 1) { --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183375; cv=none; d=zohomail.com; s=zohoarc; b=i9o2apy0WroWlbxbSjfY70QaYfkdn7xocac8PmNlm2/0SUN+p1wq4xn2EXNOjoghQI3emZDxBsIrSRDH8RJ1urbsDKP2gT4PnXfy7dqDppVCl3U9koNusb2uWq9E5Vih7y8WGCN2oXT1ddsgpDB5zuxhnvAFjF2z8wxnmvBkFrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183375; 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=N8oWnyTYg8AgJWFNvI249dMhAmQigPL79FgF3CC8NN0=; b=ExpnEW7EswoCzfMrsfuRkzaIp55Adn1HQoIXyb6d0ZBTIFl40h/OdjS61fbr1xMMyvHYWMugn2SebIbwzEIkUip+IBJk3ABMYCMLf5Ro0aYoKDSqPC9wfgfFuzOJpYvHnOtBB3GWztdTfVJgw5641L0Ddo4GpV+8GhblBYJDwrw= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183375748690.7652207191092; Tue, 24 Sep 2024 06:09:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Gf-0005Xg-2P; Tue, 24 Sep 2024 09:07:49 -0400 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 1st5G1-0002D0-5M for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:12 -0400 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 1st5Fx-0000YU-3l for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:08 -0400 Received: from mx-prod-mc-01.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-70-9mhNB2XGMKeO-mP1wQPUiA-1; Tue, 24 Sep 2024 09:06:57 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2BB51918DC0; Tue, 24 Sep 2024 13:06:54 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 07DBE197701F; Tue, 24 Sep 2024 13:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183222; 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=N8oWnyTYg8AgJWFNvI249dMhAmQigPL79FgF3CC8NN0=; b=aiopCLVLIJH1mEjFyEV5I9aUhR65PuZ7Hybg6u2/kgI/EiReMhNotdvwfXlS4BRWBcMmbE iclmg90WRIVYtxFZwo01/6c5J1ltEfAbQyjDFSJ3W7pH2Ga37Ug43iOv0+2BTINooScdsV idVXZXnsRe7N+yJPKo1OWi1WoQaMSC4= X-MC-Unique: 9mhNB2XGMKeO-mP1wQPUiA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 10/22] hw/sdhci: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:41 +0400 Message-ID: <20240924130554.749278-11-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.40 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183383038116600 From: Marc-Andr=C3=A9 Lureau ../hw/sd/sdhci.c:846:16: error: =E2=80=98res=E2=80=99 may be used uninitial= ized [-Werror=3Dmaybe-uninitialized] False-positive, because "length" is non-null. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/sd/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 87122e4245..ed01499391 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -747,7 +747,7 @@ static void sdhci_do_adma(SDHCIState *s) const uint16_t block_size =3D s->blksize & BLOCK_SIZE_MASK; const MemTxAttrs attrs =3D { .memory =3D true }; ADMADescr dscr =3D {}; - MemTxResult res; + MemTxResult res =3D MEMTX_ERROR; int i; =20 if (s->trnmod & SDHC_TRNS_BLK_CNT_EN && !s->blkcnt) { --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183437; cv=none; d=zohomail.com; s=zohoarc; b=fQwy6fmY5q77npGhoQHGjoIcWt1qP6o3CPSfzW8sq4M+qXpPsrlqHJAYQ/tYyBD6EuYSO9K8ajod5yOUkCC4ecf2Usbdd3zZjexGeFLNhvWZ+XLN8tTn7evwJcdINCQXS8O5xC0aWHOpsWJkBNvxR9E9jyrygDPdvN0KhkBSxk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183437; 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=8PUwcgtZt0hOyPV07gl666NOLQBNxh2UtOKTtC1Z66E=; b=DoFS5LMfZFCaSPQk7n6wqWoFMdjKFvsA/Mfu/1RmFy/gz+FpDXAY2l4QyELGi3u7xiMbF+mtNxh8fp2SV+4xN3pu589t3goDtRF8CXrYgmjgwDZbnLULjDOBx5MrtgvA+Qroxikaq1LODeqZfH/5qO1fk9CeOqcv4zv9XCo+AWc= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183437365496.2276604349929; Tue, 24 Sep 2024 06:10:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Hr-0002Ac-JN; Tue, 24 Sep 2024 09:09:03 -0400 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 1st5G8-0002j3-7E for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:21 -0400 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 1st5G6-0000a1-FD for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:15 -0400 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-648-ST9bMCHzNceOrNy9cSHVgQ-1; Tue, 24 Sep 2024 09:07:08 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 67A061896E34; Tue, 24 Sep 2024 13:07:05 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 817061955D4B; Tue, 24 Sep 2024 13:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183233; 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=8PUwcgtZt0hOyPV07gl666NOLQBNxh2UtOKTtC1Z66E=; b=Lzg7D4S2rW6GwAuUYPEVjuRHR7M09kr4xX20N1TpnChFT7DBGH1N4HNqzvhynHp0Oskmuv 6SHS5Awi5EaaJ41NfwUDaTjd2Pl99urUORHeILIM8rcaloK7mXl0luB/p7AgVonokzG0C1 EOV3ZBze9VFMfl8+ZLKZEcFxEXYsoPM= X-MC-Unique: ST9bMCHzNceOrNy9cSHVgQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 11/22] block/block-copy: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:42 +0400 Message-ID: <20240924130554.749278-12-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183439793116600 From: Marc-Andr=C3=A9 Lureau ../block/block-copy.c:591:12: error: =E2=80=98ret=E2=80=99 may be used unin= itialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- block/block-copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-copy.c b/block/block-copy.c index cc618e4561..7265733825 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -568,7 +568,7 @@ static coroutine_fn int block_copy_task_entry(AioTask *= task) BlockCopyState *s =3D t->s; bool error_is_read =3D false; BlockCopyMethod method =3D t->method; - int ret; + int ret =3D -1; =20 WITH_GRAPH_RDLOCK_GUARD() { ret =3D block_copy_do_copy(s, t->req.offset, t->req.bytes, &method, --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183379; cv=none; d=zohomail.com; s=zohoarc; b=gVVktQzmckQITCNNxrqRW4vhowzEuQIBDBF+oGXhM3yRj994Clv5MnoxUryLR9ntYhcwdZ7zYfkeqG/GLEFnRP+j3tSWcA2rDvnY4GlsTxk+MpJ+iCJlol3LN+64MKGQZuhqBLLH2JbI/naYCJjED5NQYW0OEZfAQ9dT+wyih68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183379; 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=OgOMuueupXqkkM9j2IUo8fknwQ3ZRkaqVwWw2fZDJ0A=; b=XU3s3Ma9Ss+dbzAgUXE0eCnH4IjM7ebilX+fAzzASrqoOsJdZECp17JT4zwKNF0jCHgiB7zPS7bTiTwow9b8/Breu+uF33ijgBiKm+BDagbYuKk9b9kP5QkWL3dRzTO7hiBrcw1YQ5ddu3WN6GCpOs68X+PkCWpYGcAra7Com3o= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183379373665.1131007883555; Tue, 24 Sep 2024 06:09:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5HU-0001Kc-Nv; Tue, 24 Sep 2024 09:08:41 -0400 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 1st5G2-0002I4-EN for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5G0-0000ZJ-UM for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:10 -0400 Received: from mx-prod-mc-02.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-659-2tkFgjMxO5mDAQOmUVnLYw-1; Tue, 24 Sep 2024 09:07:05 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5A85F18EB279; Tue, 24 Sep 2024 13:07:02 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B1F6B193497D; Tue, 24 Sep 2024 13:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183228; 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=OgOMuueupXqkkM9j2IUo8fknwQ3ZRkaqVwWw2fZDJ0A=; b=VsCxG9UmnFx0EPXqPiWVJuoPvHCvW74b66PWfSvwOUUJXOLE9GEzGRFskpJB3AujzljBl7 ncofKwWnwrB+jIgLJHof2W7bBtzDGmWG36NaosBBKF9bZ8gZA+RA//Ls/1BnmiViOSZzl7 iZilhUQcm6q0hEJijyQXNa05cH0C0cY= X-MC-Unique: 2tkFgjMxO5mDAQOmUVnLYw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 12/22] migration: fix -Werror=maybe-uninitialized false-positives Date: Tue, 24 Sep 2024 17:05:43 +0400 Message-ID: <20240924130554.749278-13-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183383048116600 From: Marc-Andr=C3=A9 Lureau ../migration/dirtyrate.c:186:5: error: =E2=80=98records=E2=80=99 may be use= d uninitialized [-Werror=3Dmaybe-uninitialized] ../migration/dirtyrate.c:168:12: error: =E2=80=98gen_id=E2=80=99 may be use= d uninitialized [-Werror=3Dmaybe-uninitialized] ../migration/migration.c:2273:5: error: =E2=80=98file=E2=80=99 may be used = uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Peter Xu Reviewed-by: Hyman Huang --- migration/dirtyrate.c | 4 ++-- migration/migration.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index 1d9db81299..32f398a754 100644 --- a/migration/dirtyrate.c +++ b/migration/dirtyrate.c @@ -149,12 +149,12 @@ int64_t vcpu_calculate_dirtyrate(int64_t calc_time_ms, unsigned int flag, bool one_shot) { - DirtyPageRecord *records; + DirtyPageRecord *records =3D NULL; int64_t init_time_ms; int64_t duration; int64_t dirtyrate; int i =3D 0; - unsigned int gen_id; + unsigned int gen_id =3D 0; =20 retry: init_time_ms =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); diff --git a/migration/migration.c b/migration/migration.c index ae2be31557..021faee2f3 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2278,7 +2278,7 @@ static bool migrate_handle_rp_resume_ack(MigrationSta= te *s, */ static void migration_release_dst_files(MigrationState *ms) { - QEMUFile *file; + QEMUFile *file =3D NULL; =20 WITH_QEMU_LOCK_GUARD(&ms->qemu_file_lock) { /* --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183379; cv=none; d=zohomail.com; s=zohoarc; b=SS7ARmRcNG8E+j7/ycB1CyNmhDITcBolM+/8YKi0gAbAb8l5Hp+bJl7HVDE7xhEOIeEt8M9M4qmsrscIYSXEY4ekDwV/xG/VlgDfHJRmlo3wnsrEdpL5SK5lNTIjxf/ICtOMGYr6wgEyxNq0y7fYHfcdY7rDBjMRZvpgKGCWFyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183379; 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=JGEPjn/sJDDOPrXtbQFNyD4mj+fADyylE8XkUYoAjZI=; b=L4bEZ7P57aUJyA5YwC34pgVvTRtZJl5PLzzczztq17V/Ct37G89FloD+ZAJHDI5j4me8lEcHqviEsG+cmtl34fFouRMbzHBAPatPqOIzAaX6cMTVnVaiw9zHpsRhMUZ0cztvg0CK0fDBx/wMUCIA7rSTXaCPao0tufeZv9Y/r3U= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183379950245.14238516887247; Tue, 24 Sep 2024 06:09:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5I7-0002JA-GO; Tue, 24 Sep 2024 09:09:24 -0400 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 1st5GY-0004z1-0i for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5GR-0000hP-QU for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:39 -0400 Received: from mx-prod-mc-02.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-645-lWdMq5hSPseDQtOdjqmKeQ-1; Tue, 24 Sep 2024 09:07:27 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 625B818BAF4C; Tue, 24 Sep 2024 13:07:16 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5D3F2190ADA8; Tue, 24 Sep 2024 13:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183251; 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=JGEPjn/sJDDOPrXtbQFNyD4mj+fADyylE8XkUYoAjZI=; b=fLwuHc9QXpqWRHmg40nVo6V5kSOB2xacTS5RZItT/SebDqVnVuv1G4t6+8lceg7ViqBLIG Fzmrdbft8v649MXtL6ta0Fy6PQL2tqnFq/1qWWC4WOZrVdD7rdHxc1CUj3V4z282p0QM6V KqzIq+R4MtW4sHgChjQRo4E7jQgukuA= X-MC-Unique: lWdMq5hSPseDQtOdjqmKeQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 13/22] hw/virtio-blk: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:44 +0400 Message-ID: <20240924130554.749278-14-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.40 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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183382126116600 From: Marc-Andr=C3=A9 Lureau ../hw/block/virtio-blk.c:1212:12: error: =E2=80=98rq=E2=80=99 may be used u= ninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella --- hw/block/virtio-blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 115795392c..9166d7974d 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1060,7 +1060,7 @@ static void virtio_blk_dma_restart_cb(void *opaque, b= ool running, VirtIOBlock *s =3D opaque; uint16_t num_queues =3D s->conf.num_queues; g_autofree VirtIOBlockReq **vq_rq =3D NULL; - VirtIOBlockReq *rq; + VirtIOBlockReq *rq =3D NULL; =20 if (!running) { return; --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183558; cv=none; d=zohomail.com; s=zohoarc; b=KdZhj/W+xZk56R2B+J8o8+zjuwQo6QZvAuIZf5cpcMiv0xZHC/CkOoUZkLeniFg1cypB3EmiwMZiIWNRBRf5I/hs58Mq32RlB4jNkdJu09sQk6jBNVMZWhjCKud7bjA8f4KSIi7boub7BAa5n7J7ZdL5BxtfWEcAZTOsCR0TMw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183558; 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=BfBhqR3KsMwXG+cr6KFYY/4Qsqr6mxnmMhogyoKBMRk=; b=OsmWvGohcyQvFpnGShvo2bDBsRfWQ/UHnAu0doIMqwTJg2cLYONvXgNQKpmUfnqiLF/DkQwIbIF+QAg21Tpb4tEYpSeBWFWsvPYX1hyY8wIMaUHGr9XA+TQLBPNKZoviP5pZDWO0avfD2SgMcBo8pyNaNGXGguF1WyRcKmaaEME= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183558108781.1582700022312; Tue, 24 Sep 2024 06:12:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Iw-0007ZP-Nb; Tue, 24 Sep 2024 09:10:14 -0400 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 1st5H9-0008G4-QY for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:21 -0400 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 1st5H4-0000j7-DV for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:16 -0400 Received: from mx-prod-mc-04.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-570-8aGgty-3OU-7Xf8qfEb8JQ-1; Tue, 24 Sep 2024 09:07:30 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A90A518C44FF; Tue, 24 Sep 2024 13:07:27 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 67C321955DCB; Tue, 24 Sep 2024 13:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183254; 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=BfBhqR3KsMwXG+cr6KFYY/4Qsqr6mxnmMhogyoKBMRk=; b=KvZ7PMFgyH5fAcJvzjjH3kIGeQWrk1B2SB1kTegTuIqofxwTkTyA0zKbMWK8tJbN68hfs2 BN/LjpOA6spfybTtKym5JLWTLz1UWM/yO6EAPtqIqHNaT2V4QqFhe0uHyi/l0CmVtKibMR 9r1fpRm3S0U05hz09INQyEx2BYTCqPo= X-MC-Unique: 8aGgty-3OU-7Xf8qfEb8JQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 14/22] migration: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:45 +0400 Message-ID: <20240924130554.749278-15-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183563922116600 From: Marc-Andr=C3=A9 Lureau ../migration/ram.c:1873:23: error: =E2=80=98dirty=E2=80=99 may be used unin= itialized [-Werror=3Dmaybe-uninitialized] When 'block' !=3D NULL, 'dirty' is initialized. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Peter Xu --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 67ca3d5d51..502368a3a6 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1795,7 +1795,7 @@ static bool get_queued_page(RAMState *rs, PageSearchS= tatus *pss) { RAMBlock *block; ram_addr_t offset; - bool dirty; + bool dirty =3D false; =20 do { block =3D unqueue_page(rs, &offset); --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183527; cv=none; d=zohomail.com; s=zohoarc; b=IVT803KmU9OfGEF/q0F05UR84U1hRg7g/buGqi1H9erF7WXGE/cplPKtLAFFgnn9YKTe6+k3ev6cZrIeznO0eKb2HOWT2TBo2UV2IUVOKBTNmlmOZ1ois7JevC2T+WaNdYI1scFpw0023esazlzhfgqZPshEaxwB21DFNZ7bHu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183527; 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=xtGJwVXMrFzPBkMfLTJwPBwE9R7SBDoRTUi3pO0/Y7E=; b=QXyF2jlpfrcGzBeUOyGUtWG/GYY6HnUU/6GMuLRp4Vzy8Qa5qPwnez8EhXaWoZVpVmBJqBmJ9YO1Ipz1LCpzt1hby+FQdtBtfj/DWRrE/ykLrRDTrCbD9mXweZE9j4CpeiOh0v6sre4nW2B9RbnHWBOIT8U6Cfaiv4fB6I/26gU= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183527426316.9084555322132; Tue, 24 Sep 2024 06:12:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Ia-0005s0-Sw; Tue, 24 Sep 2024 09:09:50 -0400 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 1st5Gf-0005pi-Kv for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:52 -0400 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 1st5Gc-0000ix-Cw for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:48 -0400 Received: from mx-prod-mc-01.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-522-DkANmJP0Pb-AN3wY3tF21w-1; Tue, 24 Sep 2024 09:07:30 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CB6A819CC95F; Tue, 24 Sep 2024 13:07:26 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3141B1955D44; Tue, 24 Sep 2024 13:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183253; 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=xtGJwVXMrFzPBkMfLTJwPBwE9R7SBDoRTUi3pO0/Y7E=; b=V55++glXjt0+GZk8+UoJkdMi8MiEDk9eUsVLAddCLrPA3JawzU6oG+OnJHX8ki53v8Uf83 DB4D93VZtdRG5vZVvHkTSCAchEhnP0hli+OD9QZ7xvg47XjdgvwplRrkDBZuAWAW6IqKTp 7zmxKKrMyTkfGS6Ipivy6d6u9Kt7RDk= X-MC-Unique: DkANmJP0Pb-AN3wY3tF21w-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 15/22] linux-user/hppa: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:46 +0400 Message-ID: <20240924130554.749278-16-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.40 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183528747116600 From: Marc-Andr=C3=A9 Lureau ../linux-user/hppa/cpu_loop.c: In function =E2=80=98hppa_lws=E2=80=99: ../linux-user/hppa/cpu_loop.c:106:17: error: =E2=80=98ret=E2=80=99 may be u= sed uninitialized [-Werror=3Dmaybe-uninitialized] 106 | env->gr[28] =3D ret; Signed-off-by: Marc-Andr=C3=A9 Lureau --- linux-user/hppa/cpu_loop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index bc093b8fe8..f4da95490e 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -43,7 +43,7 @@ static abi_ulong hppa_lws(CPUHPPAState *env) old =3D tswap32(old); new =3D tswap32(new); ret =3D qatomic_cmpxchg((uint32_t *)g2h(cs, addr), old, new); - ret =3D tswap32(ret); + env->gr[28] =3D tswap32(ret); break; =20 case 2: /* elf32 atomic "new" cmpxchg */ @@ -64,19 +64,19 @@ static abi_ulong hppa_lws(CPUHPPAState *env) old =3D *(uint8_t *)g2h(cs, old); new =3D *(uint8_t *)g2h(cs, new); ret =3D qatomic_cmpxchg((uint8_t *)g2h(cs, addr), old, new); - ret =3D ret !=3D old; + env->gr[28] =3D ret !=3D old; break; case 1: old =3D *(uint16_t *)g2h(cs, old); new =3D *(uint16_t *)g2h(cs, new); ret =3D qatomic_cmpxchg((uint16_t *)g2h(cs, addr), old, new); - ret =3D ret !=3D old; + env->gr[28] =3D ret !=3D old; break; case 2: old =3D *(uint32_t *)g2h(cs, old); new =3D *(uint32_t *)g2h(cs, new); ret =3D qatomic_cmpxchg((uint32_t *)g2h(cs, addr), old, new); - ret =3D ret !=3D old; + env->gr[28] =3D ret !=3D old; break; case 3: { @@ -97,13 +97,13 @@ static abi_ulong hppa_lws(CPUHPPAState *env) } end_exclusive(); #endif + env->gr[28] =3D ret; } break; } break; } =20 - env->gr[28] =3D ret; return 0; } =20 --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183427; cv=none; d=zohomail.com; s=zohoarc; b=Kbdk+0nmvE3AW9vkgZnYU2eF7RIrq83Fyswg+PFYAyuE1OUUeC4SuJ7IbLAOt0V0TZ8iO5fK1kYZwjSOBGRj+izK9PDhB0oSVdcDKfn16g1z3LxEFx81bJIJZlWdX9jBpgUhBPudy66/BhvLLPN5gkh5OIvliYviGHfAHp+kbHo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183427; 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=4KJE8qUD4umiZGkFcxMeE4vCoHpAfNtigMP6Qc0MhA4=; b=RHK7w4SGHvSFr7S9nYWCI++vsF6Gf/4dCVRSsa/beosdodYYacTNgexY34lc9kAXE7VcBYRfUJDQ2Nw+CziZrJi48IDYbqpOmOMAEwpAnetqThHToFWKuzHL4KTkWlvFLf2IUiobajZxM3XpERpGDVa/72OXYK6cknN2cRnNGfg= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183427207551.9511075910171; Tue, 24 Sep 2024 06:10:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5H3-0007Q5-BQ; Tue, 24 Sep 2024 09:08:13 -0400 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 1st5Gb-00058f-1h for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5GV-0000lF-Ub for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:43 -0400 Received: from mx-prod-mc-04.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-501-0ODN8lmDOnmnYRZixvcjog-1; Tue, 24 Sep 2024 09:07:31 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B74F918C4743; Tue, 24 Sep 2024 13:07:27 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A9DA3197703A; Tue, 24 Sep 2024 13:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183257; 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=4KJE8qUD4umiZGkFcxMeE4vCoHpAfNtigMP6Qc0MhA4=; b=TpLMKYug9IGJUdeu2VVVfajrIQwc+GCXDG6X60uE2oWLA/dALhCkiRGUULXp+Pk/nX+aNT fkNwmoQatmAgWunAe7f0eIfHoziRH4q7L1cOmKHBuWl4cF6Xv1K4vnYiWHrdq2EmjCxp+Q Pw5Ra9D2RVKfGAV3EcumK4yGyNIsVeE= X-MC-Unique: 0ODN8lmDOnmnYRZixvcjog-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 16/22] target/loongarch: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:47 +0400 Message-ID: <20240924130554.749278-17-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183428318116600 From: Marc-Andr=C3=A9 Lureau ../target/loongarch/gdbstub.c:55:20: error: =E2=80=98val=E2=80=99 may be us= ed uninitialized [-Werror=3Dmaybe-uninitialized] 55 | return gdb_get_reg32(mem_buf, val); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../target/loongarch/gdbstub.c:39:18: note: =E2=80=98val=E2=80=99 was declar= ed here 39 | uint64_t val; Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/loongarch/gdbstub.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c index 7ca245ee81..3a03cf9cba 100644 --- a/target/loongarch/gdbstub.c +++ b/target/loongarch/gdbstub.c @@ -34,26 +34,28 @@ void write_fcc(CPULoongArchState *env, uint64_t val) int loongarch_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int= n) { CPULoongArchState *env =3D cpu_env(cs); - uint64_t val; - - if (0 <=3D n && n < 32) { - val =3D env->gpr[n]; - } else if (n =3D=3D 32) { - /* orig_a0 */ - val =3D 0; - } else if (n =3D=3D 33) { - val =3D env->pc; - } else if (n =3D=3D 34) { - val =3D env->CSR_BADV; - } =20 if (0 <=3D n && n <=3D 34) { + uint64_t val; + + if (n < 32) { + val =3D env->gpr[n]; + } else if (n =3D=3D 32) { + /* orig_a0 */ + val =3D 0; + } else if (n =3D=3D 33) { + val =3D env->pc; + } else /* if (n =3D=3D 34) */ { + val =3D env->CSR_BADV; + } + if (is_la64(env)) { return gdb_get_reg64(mem_buf, val); } else { return gdb_get_reg32(mem_buf, val); } } + return 0; } =20 --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183376; cv=none; d=zohomail.com; s=zohoarc; b=bfm257oUPKTTmz1UvhQFinWdL48NVXrNQdGOi9RfKmhF5l+wo2GTf55yNjD9leBu2k37gL9yV6G23dHHgyuKMD2KXqMLmnvGxK5LdF0dmD4XLEhLyx9l4s9Vr5CmTAJ0lXZ4ys82wn5FTz/+87r7OQfL1fuBuJQHXZ1aw0gxXAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183376; 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=NAK9HSEf/74uNdIIqZP2L3zUsV6HNSqDIlQaYXiyyvc=; b=epwfr4jakGDBdfW1SyhBeHvB4wf+TH3ntNWPqeh3nRvE5axTz7qN027iE+uweeNWlFWQRokYwQ+0XqdUEymLyOvdGG4AMJeDzNV6MJbafhaj81ZMx1Fd6fNE7f+iG9sSAr+IpWGjSgSDfsOQ13rkxFOwifRjKAtX7rvJUil2ZZI= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183376358186.39116085638545; Tue, 24 Sep 2024 06:09:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Hl-0002BF-Ki; Tue, 24 Sep 2024 09:08:57 -0400 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 1st5HP-0000ul-FL for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:35 -0400 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 1st5HM-0000qj-SZ for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:34 -0400 Received: from mx-prod-mc-04.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-168-lRfZJdgqMi2yoww-yyD_Bw-1; Tue, 24 Sep 2024 09:07:42 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 40A201902F6B; Tue, 24 Sep 2024 13:07:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 30EDA1955EB3; Tue, 24 Sep 2024 13:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183265; 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=NAK9HSEf/74uNdIIqZP2L3zUsV6HNSqDIlQaYXiyyvc=; b=JOCFnI4A7WuZsLbZj+ZAghTKyTJ45OxETJe9z3xvtvODrnvKvdl3cr0awBK4wGwNwXN/Gj ugLBabPLDMF2/1MVnQOxKhsxd0gDCQvMvVWBWlvWA8mrfyn11FTGW164Th9fqpxz5umsx8 viLf18Bd0GBiXLJBstP8cP//SdDunuY= X-MC-Unique: lRfZJdgqMi2yoww-yyD_Bw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 17/22] tests: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:48 +0400 Message-ID: <20240924130554.749278-18-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183378125116600 From: Marc-Andr=C3=A9 Lureau ../tests/unit/test-block-iothread.c:773:17: error: =E2=80=98job=E2=80=99 ma= y be used uninitialized [-Werror=3Dmaybe-uninitialized] /usr/include/glib-2.0/glib/gtestutils.h:73:53: error: =E2=80=98ret=E2=80=99= may be used uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/unit/test-bdrv-drain.c | 2 +- tests/unit/test-block-iothread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c index 666880472b..c112d5b189 100644 --- a/tests/unit/test-bdrv-drain.c +++ b/tests/unit/test-bdrv-drain.c @@ -722,7 +722,7 @@ static void test_blockjob_common_drain_node(enum drain_= type drain_type, BlockJob *job; TestBlockJob *tjob; IOThread *iothread =3D NULL; - int ret; + int ret =3D -1; =20 src =3D bdrv_new_open_driver(&bdrv_test, "source", BDRV_O_RDWR, &error_abort); diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothr= ead.c index 3766d5de6b..20ed54f570 100644 --- a/tests/unit/test-block-iothread.c +++ b/tests/unit/test-block-iothread.c @@ -745,7 +745,7 @@ static void test_propagate_mirror(void) AioContext *main_ctx =3D qemu_get_aio_context(); BlockDriverState *src, *target, *filter; BlockBackend *blk; - Job *job; + Job *job =3D NULL; Error *local_err =3D NULL; =20 /* Create src and target*/ --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183497; cv=none; d=zohomail.com; s=zohoarc; b=iZhL+iTcULLrufJ+If48wL9bqAdhaaE8RlvSP+icq1gOjH3c6kgOCSG8ApASAUKwGgleLfqZRNMcAgwzIrL5i8l16Jvf/1D8lBZe9AuukOHWHomhTK/VMRjAxL4cplsBZMUgL/JTUeFdqzNH3SHVMfrohrc5SUUXw1IoSDnzveI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183497; 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=U9mSRuRV9kL6i+j8O8fsCuIK9js7cJJ4qwxGkLMTjwY=; b=VwRVSy77/5lN/Lnewcs6hgormq7ZSCkZs3lzQSlf/KvdbO9sFQHFpnXGsRnF9xoXgeOnWJUB26/MXuQihF9NA/hhWaS82BnCpdtUCbLUH4rRwKMATL67LzCyux1aCOrpCQAgfqaC3Jdm7n8Mnaqpt/YZJ6IxIPFmoV0YYCeFaN4= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183497193724.2710048734624; Tue, 24 Sep 2024 06:11:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5HP-0000fL-8v; Tue, 24 Sep 2024 09:08:35 -0400 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 1st5Gg-0005t7-Q4 for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5Gc-0000qg-Jq for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:48 -0400 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-35-CM4lndipOgayGbb1Z5RQRQ-1; Tue, 24 Sep 2024 09:07:42 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [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 0C58118DB7EA; Tue, 24 Sep 2024 13:07:39 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AE9BA195394E; Tue, 24 Sep 2024 13:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183265; 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=U9mSRuRV9kL6i+j8O8fsCuIK9js7cJJ4qwxGkLMTjwY=; b=RglbVqKJYnOOORxfZywJoQFvngzQIxMTwfY2pQsNUawsCZt1tn/21otXVikKhu62/BichE 3WhoZZjskQxTJw8P7eIwFV/tUCYHG2VgFvl4XNX96jv/gz5y0Wgv4i7XcEePUpAJVUq5oF qSN9Bk09pzBfpYXC2E+7f6C1BmGZ1Oc= X-MC-Unique: CM4lndipOgayGbb1Z5RQRQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 18/22] hw/virtio: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:49 +0400 Message-ID: <20240924130554.749278-19-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183498333116600 From: Marc-Andr=C3=A9 Lureau ../hw/virtio/vhost-shadow-virtqueue.c:545:13: error: =E2=80=98r=E2=80=99 ma= y be used uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Eugenio P=C3=A9rez --- hw/virtio/vhost-shadow-virtqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-vi= rtqueue.c index fc5f408f77..cd29cc795b 100644 --- a/hw/virtio/vhost-shadow-virtqueue.c +++ b/hw/virtio/vhost-shadow-virtqueue.c @@ -526,7 +526,7 @@ static void vhost_svq_flush(VhostShadowVirtqueue *svq, size_t vhost_svq_poll(VhostShadowVirtqueue *svq, size_t num) { size_t len =3D 0; - uint32_t r; + uint32_t r =3D 0; =20 while (num--) { int64_t start_us =3D g_get_monotonic_time(); --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183513; cv=none; d=zohomail.com; s=zohoarc; b=g1irKlb7mjvG89hLq8K2AsnL8DZKgx0/KXqfGb8uz7G8ArTXTIljToh1tjORgHLyAGYs/6hvjkeuS0iocUbnmENArp2uYpjAFs4A5XAAxXIwmb9NP6SokrrjbqpjXXeXENjI1+wgIAUwu5+Or8LoyS49/YQjYusIyjiKZvlqRT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183513; 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=8kITW/qOItfiafJDWQ5dEslsyyB81A9V60goYSoquHw=; b=Zue1h06R1OVell6nOpMen5h2uccA+Ez1ZJLhq3nD8jb7TjpqwumkJwfugMfLKBnhIVJQUPje1Cg3OGgX32l4qDoKr5C4tIth2OpznKB9x+fECucx3NeqG7wfb7feO51irrtUDYj5bBaMeGM7cyTvI4lfdo6afF2ChXNsLGKnMc8= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183513762738.8991330844791; Tue, 24 Sep 2024 06:11:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Il-0006pq-TC; Tue, 24 Sep 2024 09:10:00 -0400 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 1st5Gp-0006bg-TM for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:03 -0400 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 1st5Gi-0000se-LZ for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:07:55 -0400 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-322-2T_0FyEAN5myzxBGqR1yOQ-1; Tue, 24 Sep 2024 09:07:47 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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 787561896E34; Tue, 24 Sep 2024 13:07:44 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5275B19560AA; Tue, 24 Sep 2024 13:07:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183270; 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=8kITW/qOItfiafJDWQ5dEslsyyB81A9V60goYSoquHw=; b=Z21gq+XPSPBdkJHtce0rZH3nB6sHghFv7IH+kvwUYh2JFTZU3Eg0FAmftsIAJbeAAQybwD hZyID65mipl5Tq3p+4pDZQRjpJIMWeF6K2dP03wKDd4ts40Dc00OuuhMAkPx3rF4NNk0Yk S6RAJNqtziVHybBR0zZ+YFu1pgp+OI8= X-MC-Unique: 2T_0FyEAN5myzxBGqR1yOQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 19/22] block: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:50 +0400 Message-ID: <20240924130554.749278-20-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.40 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183533773116600 From: Marc-Andr=C3=A9 Lureau ../block/file-posix.c:1405:17: error: =E2=80=98zoned=E2=80=99 may be used u= ninitialized [-Werror=3Dmaybe-uninitialized] 1405 | if (ret < 0 || zoned =3D=3D BLK_Z_NONE) { Signed-off-by: Marc-Andr=C3=A9 Lureau --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index ff928b5e85..90fa54352c 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1398,7 +1398,7 @@ static void raw_refresh_zoned_limits(BlockDriverState= *bs, struct stat *st, Error **errp) { BDRVRawState *s =3D bs->opaque; - BlockZoneModel zoned; + BlockZoneModel zoned =3D BLK_Z_NONE; int ret; =20 ret =3D get_sysfs_zoned_model(st, &zoned); --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183542; cv=none; d=zohomail.com; s=zohoarc; b=YS6KFxI/BG/+0vlcipTgFBFIkBijavBrNUhQFDXA9z84LjhBTifG8rMC6vvifs7zKfy2V9Ao2+rKYkoEQX9VnxWAEO9VU3zIHu8RdXzPCHojfckdiHkJA/9eHYwpKHBTH7aQggzbiOnSv7/Td24vVeGI/3Jr/BGRQTqRpGTSmyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183542; 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=lUrGKd55q1ZNBh1Nc+f+485x2fmivUGDYmWx4uvjSn4=; b=lw3HGgRcxHL+mlNQO5F4RgHgjrb9HSr2TvOyaQlPzM+/jfCw/X1Pkpp/HgporT9hYgn932h2gnuFCq9aBqQCs7dfk8NNzuN30q4sSemMFMJcfTEOHiS0V3forTrKqD3WlPZ0N9jjnHUfca5UlJSZ1MzuY6rM24kfB4FXluKum6Y= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183542402396.80723207528047; Tue, 24 Sep 2024 06:12:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5KJ-0006M7-7g; Tue, 24 Sep 2024 09:11:35 -0400 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 1st5HR-00018s-Dp for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5HP-0000tR-5I for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:37 -0400 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-413-VEGB2Zl4NgCd0KFx5v39jA-1; Tue, 24 Sep 2024 09:07:52 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (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 93DBF18E6DA6; Tue, 24 Sep 2024 13:07:49 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 30C36195608A; Tue, 24 Sep 2024 13:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183276; 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=lUrGKd55q1ZNBh1Nc+f+485x2fmivUGDYmWx4uvjSn4=; b=REwfVtQvIwzMHzlu5HIr/FXXreHnzPhJabKz5v81+kvQCV03aYajpvCswiYyHSmbpfjuQq KCYEpo1+Q0bzQcdtj3pAOil+4IUVT5gJGRyNG2+oVV4C5XFweL090D6ASqu6LZHkuYmVZW YrpETgyR3SENF4LML1LdLPRuXX0mDpI= X-MC-Unique: VEGB2Zl4NgCd0KFx5v39jA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 20/22] qom/object: fix -Werror=maybe-uninitialized Date: Tue, 24 Sep 2024 17:05:51 +0400 Message-ID: <20240924130554.749278-21-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.15 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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183544518116600 From: Marc-Andr=C3=A9 Lureau object_resolve_path_type() didn't always set *ambiguousp. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qom/object.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index 157a45c5f8..b2120f7dc5 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2202,6 +2202,9 @@ Object *object_resolve_path_type(const char *path, co= nst char *typename, } } else { obj =3D object_resolve_abs_path(object_get_root(), parts + 1, type= name); + if (ambiguousp) { + *ambiguousp =3D false; + } } =20 g_strfreev(parts); @@ -2227,7 +2230,7 @@ Object *object_resolve_path_at(Object *parent, const = char *path) =20 Object *object_resolve_type_unambiguous(const char *typename, Error **errp) { - bool ambig; + bool ambig =3D false; Object *o =3D object_resolve_path_type("", typename, &ambig); =20 if (ambig) { --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183479; cv=none; d=zohomail.com; s=zohoarc; b=ig5Tz3hUaXP37MVr+AbxkmWOdHXwYXr+nnGEnBrMEC1KVwiUYHBQmvkzQCyGfZFOzOpU/0Jcq3JbA3mvj03bSa302/ltYDLFdksy8G25ePWH5MtS/yObGlXRJHTG2BW30o8uVn8nEToZOSolXcRNdfW0XmBQ4QBLMmtOI/zZyIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183479; 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=rirjT2vWchNWdq7Xp3Tgw1/mVLkdbrmL/S6S8SjDtyE=; b=Wggjg6B62x3MvFgqpn/iI6YTM1+VV236dXEeQosaqeKyo38UzM8OCInP5KETj4b1LLR4BRu0OqWaATmf40YOcu/pe2zpSQuQhwBKbfIJn0IWxeiA3RlFCq6DUbMOMFho1WdWqwQC5hrP1DP1Wh1jlJi54cE6MUv3iNgtW+34UfE= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183479169119.46038580130949; Tue, 24 Sep 2024 06:11:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Hc-00027K-MY; Tue, 24 Sep 2024 09:08:52 -0400 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 1st5H1-0007Rz-75 for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:11 -0400 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 1st5Gw-0000ti-Dw for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:08 -0400 Received: from mx-prod-mc-04.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-198-YKCXA9daPCiV4IobNeiP-g-1; Tue, 24 Sep 2024 09:07:57 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4085B18EBFB3; Tue, 24 Sep 2024 13:07:54 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1B978195608A; Tue, 24 Sep 2024 13:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183280; 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=rirjT2vWchNWdq7Xp3Tgw1/mVLkdbrmL/S6S8SjDtyE=; b=L44vUK+R5Tpk8R8jdiMf3mrw6GyEbCosOaJlzMbOQeD2RWqjz7Fx6QVQHWxzIh/ePrlM6j CqV9NVLXdqbg7hjKl/WethMaVdmNbDqDo+SlhQKW6RpdHmTNqY1OkA1RVHYUPMgw1JrhpA pWT82EfuDqZGhKuIEX2sNPg9LzcTRxE= X-MC-Unique: YKCXA9daPCiV4IobNeiP-g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 21/22] fsdep/9p: fix -Werror=maybe-uninitialized false-positive Date: Tue, 24 Sep 2024 17:05:52 +0400 Message-ID: <20240924130554.749278-22-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.15 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183480289116600 From: Marc-Andr=C3=A9 Lureau ../fsdev/9p-iov-marshal.c:93:23: error: =E2=80=98val=E2=80=99 may be used u= ninitialized [-Werror=3Dmaybe-uninitialized] and similar Signed-off-by: Marc-Andr=C3=A9 Lureau --- fsdev/9p-iov-marshal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fsdev/9p-iov-marshal.c b/fsdev/9p-iov-marshal.c index a1c9beddd2..75fb87a490 100644 --- a/fsdev/9p-iov-marshal.c +++ b/fsdev/9p-iov-marshal.c @@ -84,7 +84,7 @@ ssize_t v9fs_iov_vunmarshal(struct iovec *out_sg, int out= _num, size_t offset, break; } case 'w': { - uint16_t val, *valp; + uint16_t val =3D 0, *valp; valp =3D va_arg(ap, uint16_t *); copied =3D v9fs_unpack(&val, out_sg, out_num, offset, sizeof(v= al)); if (bswap) { @@ -95,7 +95,7 @@ ssize_t v9fs_iov_vunmarshal(struct iovec *out_sg, int out= _num, size_t offset, break; } case 'd': { - uint32_t val, *valp; + uint32_t val =3D 0, *valp; valp =3D va_arg(ap, uint32_t *); copied =3D v9fs_unpack(&val, out_sg, out_num, offset, sizeof(v= al)); if (bswap) { @@ -106,7 +106,7 @@ ssize_t v9fs_iov_vunmarshal(struct iovec *out_sg, int o= ut_num, size_t offset, break; } case 'q': { - uint64_t val, *valp; + uint64_t val =3D 0, *valp; valp =3D va_arg(ap, uint64_t *); copied =3D v9fs_unpack(&val, out_sg, out_num, offset, sizeof(v= al)); if (bswap) { --=20 2.45.2.827.g557ae147e6 From nobody Tue Oct 22 23:23:18 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1727183524; cv=none; d=zohomail.com; s=zohoarc; b=BPDQ3lCeljoP8Jwmp0h293Zi+i8GxDuC6N4oJUDsTnSzczAncg/flwtPrMc5O6X7VVz/yx96PdItl3dZ3bOrFhV3JxHmSzRFBQBMjAxW5/+XnXBCQO+vvWz0lEhO+C8JLMhx3q9qebXwW4DIs8JC45jTk11OikSVMT8vWW4U9g0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727183524; 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=B8l9eC89X+1DxPUZjSpPht5D6DMQbUzcLG5D0Ldv6Xg=; b=EitfO9F6Z/83hrbRxydEFwn/AiEKd5RP7rSNp0BUDSOuOGMuiElNvuzAkjPHv/s3g2WFMsOUfbifXLQn7fP5yCy+USdNDSQWroa4yY46X/oLYdOwyrrkE2GQHAQ9aa8VJFoJQmGkN/IEG/GL+1g4gtePsq4GshXnEbDTVKdCWu8= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727183524599742.8359834572697; Tue, 24 Sep 2024 06:12:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Hu-0002Cz-Ga; Tue, 24 Sep 2024 09:09:06 -0400 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 1st5HR-00015F-2K for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st5HP-0000u3-4z for qemu-devel@nongnu.org; Tue, 24 Sep 2024 09:08:36 -0400 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-617-vSZ_wSWsMBSxk5zmjsaE6g-1; Tue, 24 Sep 2024 09:08:02 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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 B4AFE18E6DA6; Tue, 24 Sep 2024 13:07:58 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A2ADA19560AD; Tue, 24 Sep 2024 13:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727183285; 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=B8l9eC89X+1DxPUZjSpPht5D6DMQbUzcLG5D0Ldv6Xg=; b=WYxtDGmQiyiD2quQ8l0mbq9UmWdwvhWRJfTb6mgGgWE2VgkTjnHoboFNB5oreuRPnrEZSd mfqvjWDkAsrl0Z+02FK16QMU7UdABK2jgD+VLvt3ZLrtn5cn1x2Fuxw9SZTuTuD3i7n0b8 13s8e7m6vKr5NaZukl9XcNfyYtW1sb4= X-MC-Unique: vSZ_wSWsMBSxk5zmjsaE6g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Song Gao , Peter Xu , Bin Meng , Mahmoud Mandour , Hyman Huang , Klaus Jensen , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Jesper Devantier , Bin Meng , Greg Kurz , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefan Hajnoczi , Yuval Shaia , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Christian Schoenebeck , Pierrick Bouvier , Fabiano Rosas , Keith Busch , Eric Blake , qemu-block@nongnu.org, Kevin Wolf , Laurent Vivier , Gerd Hoffmann , Fam Zheng , Eduardo Habkost , Stefano Garzarella , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 22/22] RFC: hw/virtio: a potential leak fix Date: Tue, 24 Sep 2024 17:05:53 +0400 Message-ID: <20240924130554.749278-23-marcandre.lureau@redhat.com> In-Reply-To: <20240924130554.749278-1-marcandre.lureau@redhat.com> References: <20240924130554.749278-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.40 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.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.09, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1727183526351116600 From: Marc-Andr=C3=A9 Lureau vhost_svq_get_buf() may return a VirtQueueElement that should be freed. It's unclear to me if the vhost_svq_get_buf() call should always return NUL= L. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/virtio/vhost-shadow-virtqueue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-vi= rtqueue.c index cd29cc795b..93742d9ddc 100644 --- a/hw/virtio/vhost-shadow-virtqueue.c +++ b/hw/virtio/vhost-shadow-virtqueue.c @@ -414,6 +414,7 @@ static uint16_t vhost_svq_last_desc_of_chain(const Vhos= tShadowVirtqueue *svq, return i; } =20 +G_GNUC_WARN_UNUSED_RESULT static VirtQueueElement *vhost_svq_get_buf(VhostShadowVirtqueue *svq, uint32_t *len) { @@ -529,6 +530,7 @@ size_t vhost_svq_poll(VhostShadowVirtqueue *svq, size_t= num) uint32_t r =3D 0; =20 while (num--) { + g_autofree VirtQueueElement *elem =3D NULL; int64_t start_us =3D g_get_monotonic_time(); =20 do { @@ -541,7 +543,7 @@ size_t vhost_svq_poll(VhostShadowVirtqueue *svq, size_t= num) } } while (true); =20 - vhost_svq_get_buf(svq, &r); + elem =3D vhost_svq_get_buf(svq, &r); len +=3D r; } =20 --=20 2.45.2.827.g557ae147e6