From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621313; cv=none; d=zohomail.com; s=zohoarc; b=f2gTi3oS3LArrk5EJJ4TCW3K8IvBeLsBumajliFD7DkrGiXQmplScv7GPXyOJ1TsThv9ZGISv0BB+C/49NsgUi6zUsSBlEgJ1si9gn9AFJE60K/zktozUjaK00b5bh5D7xvkt58mM2bn9qiuytF//HLo/lXQNk5DTBecxIYhczQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621313; 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=KaTYed9JbKbDUOzCmrNKFs9q/ptXCkoB2hyDBvj3iIk=; b=WVVDtlGzPlBtehtKUvJ4pPDJ43yBdc3nKm2vmVuOZVxXLdmbbIJteWjeaYc2xzWOMXa38WH49XP7Z4UTeFIAbvjQ9sZ1wI+dE011y4Ynz9CDdEzzxGnk2uhDeu9slygB8DBgBYU2OG3Vl4Je2RPvRDqwCjK7le3NVOelul26PMA= 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+importer2=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 1711621313213103.72163804747174; Thu, 28 Mar 2024 03:21:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmsr-0001C5-J5; Thu, 28 Mar 2024 06:21:21 -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 1rpmsp-0001Bi-OF for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21: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 1rpmso-0007dR-F4 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:19 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-r5ueP5g9PAucweE_MeRArA-1; Thu, 28 Mar 2024 06:21:11 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8E395803FC7; Thu, 28 Mar 2024 10:21:10 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A4A317AA3; Thu, 28 Mar 2024 10:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621277; 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=KaTYed9JbKbDUOzCmrNKFs9q/ptXCkoB2hyDBvj3iIk=; b=RNmgj26/74hRTnN6PMIyzyEBLgJD4SjwQL3Hg35cF0JzSJOPLxUmOYcnRht8NIL5xrSfAX XrK2qOfXwjMMlVtFf/sKaQppCg0PJg56EWbwSM8DWccNtBMJsUs7nU0y+KsMqdTU45HlWy fSunecRea6eGejY5qtkDThHuh/3gBkY= X-MC-Unique: r5ueP5g9PAucweE_MeRArA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 01/19] util/coroutine: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:34 +0400 Message-ID: <20240328102052.3499331-2-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.5 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621314207100001 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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621309; cv=none; d=zohomail.com; s=zohoarc; b=CAVg3ouf325uf4qkDIomNFCuvuQHLGrhoqeMeePAUxQkehz2OsPYozevDnRMl9+FHCGsOcGKLZZ9Pi9hC744do4kjSxDHP7cjGy6+psipps3TnQ2IV/LfXzYCgdh/9Rw/3GeFX29+In9zf/KFYsMaV4mSn9WjWemuorWGKWxMVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621309; 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=y3wvKkniOci8N/E6JK6BGXDPTZsW6UL+VmwHgyGsXKs=; b=AkHobn1Jq5Hjz1WI7+b2tX+KQ0DUiPOCWBDewAjmsy2Zy44om9o9cGZEpsZHbUD7ugNIiPzbWa9X+Dz/+vq760FQ08Pyk0W944Psib/yNzrwpUt6D0lp+1S02PJ6o77c7aItB3C2w+0nKRBV7i2K4/lPRJotnrHUrmhxP/KRJds= 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+importer2=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 17116213091501000.0679842713149; Thu, 28 Mar 2024 03:21:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmsz-0001Dp-W7; Thu, 28 Mar 2024 06:21:30 -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 1rpmsy-0001Df-42 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21: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 1rpmsw-0007f8-NY for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:27 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-548-d3SQsnc4O-6PzZrNmZvk3g-1; Thu, 28 Mar 2024 06:21:20 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D8A63815EFA; Thu, 28 Mar 2024 10:21:19 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DD2917AA0; Thu, 28 Mar 2024 10:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621286; 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=y3wvKkniOci8N/E6JK6BGXDPTZsW6UL+VmwHgyGsXKs=; b=axyt6EsK8bS+bm05yeeeexHEJbuVEcPU8z2IKHFYtog+xpziWN0YjYdciEpe6u29nh7yPV aEwq4k+rr6vssQk/08YKjXlhu+gb+pKIgxONfnrxCvhSlTjk0/ToCwbaHRL+Usy2MVcImb NHPo+tb67JICD7eQ0V81bQBXpVG+3/k= X-MC-Unique: d3SQsnc4O-6PzZrNmZvk3g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 02/19] util/timer: with -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:35 +0400 Message-ID: <20240328102052.3499331-3-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.5 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621310734100001 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 --- 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 6a0de33dd2..12b22cf69b 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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621340; cv=none; d=zohomail.com; s=zohoarc; b=iUm0vOrjU5Dfc7Ro88RVkoN4vVy0fPkIFRYY0mlXvb9DjO7NESxnnNJp5hgCPbLe96p6dl83+ODqMFwaB79MT2oqcbKLgqZ4ZyIEV7bD/EXiwUyrSqeCpfKIJQsYK+CyAb4SWPPFev2imgooy3SLADnHi6UVYO6bWCQ1s7pGOQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621340; 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=y/vamgEPesv1LH1WTnyWl39ppKFCa3bicitEsVUYD2Q=; b=VzN0m3h6JN8ejcYXO2bwANESlcjQzHAAugIr86ThGmSPKDhQwmCMqfsuxQkxLUlQNTa9ZYRCqpbHMUJYJYowqaw4u9KpnxMJXlQlICRAjBx2h/T2+oW3KA4kMI9z/TSRXhTX1l+WFGAHLYPzvaVwhATTu5S4jsEmm+x/Mjm+zxs= 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+importer2=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 171162134068331.288514729390045; Thu, 28 Mar 2024 03:22:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmtH-0001JO-Pc; Thu, 28 Mar 2024 06:21:48 -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 1rpmtF-0001Ix-9f for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:45 -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 1rpmtD-0007gQ-Re for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:45 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-280-yrvhd50lN6SNEghHVn2bjw-1; Thu, 28 Mar 2024 06:21:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 520548007A2; Thu, 28 Mar 2024 10:21:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 780673C20; Thu, 28 Mar 2024 10:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621303; 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=y/vamgEPesv1LH1WTnyWl39ppKFCa3bicitEsVUYD2Q=; b=SvdrphbEb0ZykrUf9DW62ioNvPiFpL14EoA6cBs58ycNYbNPeAxvB+xm8qqnvVrT6YzqeO 1JVE4P4DVTImav7przaV5ihucUbYoB/FdM6Pgtfqx5KbYFBPUWNWp5p6my/tAbY3gcmTTe 6F0cPdcNOLsKQV0MBbsWndOiQF2Qev4= X-MC-Unique: yrvhd50lN6SNEghHVn2bjw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 03/19] hw/qxl: fix -Werror=maybe-uninitialized false-positives Date: Thu, 28 Mar 2024 14:20:36 +0400 Message-ID: <20240328102052.3499331-4-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.1 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621342330100001 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 --- 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 7178dec85d..cfea4e7af5 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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621348; cv=none; d=zohomail.com; s=zohoarc; b=Mo+yerEHvCSEcPo8Czv2QmceejLiO1+I+d7vJFFTBthk93ozFb8E/yPA0i0TdW1jGDTX1aAl+cgXyCF9UK9ru1zqwt1j0xX9H75yNnU2+Btz2p7L7S9YBUQDBnfDTEY0H2Kx+6DpDYvT1XtxRUidUWWZzmDSMiUbR2mN9abm66U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621348; 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=EZXGqjezLQknOl9DTqO4g0fNDh8PejkqsUV/dtx7G1Q=; b=HDA3Oa/PXztrWqEa6vuH+aE68C3bKNQYb6mt1JIJ6WZtThVeww9ZWnSxuRn3KNdYYWjmU0y/IjTyGrXHEqgk9JN7DnIlwXMBmQ053aekbKUBTgiJ2YobpPLvl8Tkkae1iR3OzFCmUerhHwYyTXUWkrzkhLkoALzmMrm6bbMrLPk= 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+importer2=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 1711621348226674.107275121647; Thu, 28 Mar 2024 03:22:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmti-0001t2-Bj; Thu, 28 Mar 2024 06:22:15 -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 1rpmtP-0001Ze-Ij for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:01 -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 1rpmtO-0007iK-53 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:55 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-mQehkmTNPGKvR92PlfN4jA-1; Thu, 28 Mar 2024 06:21:48 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 631FB1C04198; Thu, 28 Mar 2024 10:21:47 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DB7D492BC8; Thu, 28 Mar 2024 10:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621313; 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=EZXGqjezLQknOl9DTqO4g0fNDh8PejkqsUV/dtx7G1Q=; b=Dh9yl7TbG7Ps64ZXXEP6ikYESBoIthtiU6nxevOSa2lCvMCZfrmMv0qHRFZ7qVA1e5oSLq mfA8Bc+zjBi+aDHoRYyfInCMv/nJe/J7I5dDuNctekUmsSx6HiVkgoKrEX9sPJLzCZPQev uWv4vGp+HYKD9GeK8Zk0aDmP9ZMevX0= X-MC-Unique: mQehkmTNPGKvR92PlfN4jA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 04/19] nbd: with -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:37 +0400 Message-ID: <20240328102052.3499331-5-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.9 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621350350100003 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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621363; cv=none; d=zohomail.com; s=zohoarc; b=aC66Mrd4sGXbCVFm8YBFDfrTVk2Gr/mI9ynQKAtfgiIyyusZFwHsxA+SL8eN/VOqk99LGU4AHB8gPZCrzQOOr+7Z96XzI88icqD6tN56aSoH7v77flzPO/RpYLkIkyDGPDo2SZG0X1LWrIi5J6yQmF0aHcr1qOMZD0g5zpmNNEM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621363; 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=0O2oh/ewqObmBKDUNq/tce2cGYYv3eGMGKiYbvHD3Ow=; b=BD4dat7i//e8b1TLhUOFkLtH15d9B2XlVa3PH1nHT96PmeDEW64uc1oHgdCQVw2/fcUk2//i/Y+DSBPYhc73TniXQj3p86pR7Ffp1GgODhRtSkufnTn2hicPpqrT8fMNu3+Wd1bpvdKsV/Xp1QgPIGjAFgw/IXnP5XS+c304xts= 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+importer2=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 1711621363499930.7034258211814; Thu, 28 Mar 2024 03:22:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmtr-0002Le-51; Thu, 28 Mar 2024 06:22:23 -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 1rpmta-0001mk-Az for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:06 -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 1rpmtW-0007it-Gb for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:03 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-OEHL0HFaOmGOFXBfmS-8RQ-1; Thu, 28 Mar 2024 06:21:57 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 108091C0650B; Thu, 28 Mar 2024 10:21:56 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E8FD492BD7; Thu, 28 Mar 2024 10:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621321; 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=0O2oh/ewqObmBKDUNq/tce2cGYYv3eGMGKiYbvHD3Ow=; b=UR9y6L8XD//XUSKPgACZLyH60EK5CalH5uOEYD33MevfZ7x1EXjML8PbL9LRXiwI8OKyfe zmfXqdvIVZYpMwRAkKRWgwi267Smx9ZhJKjcjjoASQpL0L+l6mbSWNngB5tbSnf5XScdib lUg9fad7Il9ANXCFOvdlO6awAERwld8= X-MC-Unique: OEHL0HFaOmGOFXBfmS-8RQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 05/19] block/mirror: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:38 +0400 Message-ID: <20240328102052.3499331-6-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.10 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621364499100002 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 1bdce3b657..53dd7332ee 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -926,7 +926,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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621366; cv=none; d=zohomail.com; s=zohoarc; b=SIHQ6WihZUJINfUxcMDGsbe28PE7LmauyETB9L6FSjUdFveOQxJXpU8YBU6JuY4/Kpih+/eucaY6JghThGtQw6VrbcnhJTydYI87iC+mC1fJv9Qz41AUZVC5wrRu8zy25xCjH0SNrzeuZovY/um6VPnMrkGqEYmS6Vt1q+itUFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621366; 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=GrnGE29PSFeL3UMwDPbWkEIoIwZ6RbhGysI0U5zHMB4=; b=ebjCeVkLwAjWUfRFpepA68n3/bmQRpGart7+ZgixHwoqDgY03/W2MuzmFWNYRDBZ7KP9ZwEv5t0BOjfoIiZCKDXDRkmYUDScGOfVuoQrZU1FuFHvG5m/TsM5KcZ4BZ1JcRS3/WK3ro+GGDTjkh8O0rQjfomiRSDQMnNHAxwyqhA= 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+importer2=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 1711621366900594.6978227516897; Thu, 28 Mar 2024 03:22:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmtt-0002ak-7o; Thu, 28 Mar 2024 06:22: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 1rpmtg-0001tv-9c for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:13 -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 1rpmte-0007jn-IZ for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-240-LuFJJhqGP4uod3fv4SWGcQ-1; Thu, 28 Mar 2024 06:22:06 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 33945803FC4; Thu, 28 Mar 2024 10:22:05 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44679492BD0; Thu, 28 Mar 2024 10:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621330; 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=GrnGE29PSFeL3UMwDPbWkEIoIwZ6RbhGysI0U5zHMB4=; b=HRgxVIBy0d6zQ1nDZHyTKAM/yel5Sqbb8TJ6naNaKB93iYMklvetEdBi4ZslJa+vYgWcs0 upQMoPBMHkqd/mIEJy6rNNmpKYfDW/ifW8+YbTYG6CpY+ONcO3VpbaKzcPsnQZhQQNSMBp faDqDNNt7ARQGjg+hzHTfLJZbG7dh8o= X-MC-Unique: LuFJJhqGP4uod3fv4SWGcQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives Date: Thu, 28 Mar 2024 14:20:39 +0400 Message-ID: <20240328102052.3499331-7-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.10 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621368441100001 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 --- 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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621376; cv=none; d=zohomail.com; s=zohoarc; b=IRhilOk2DuEgAlAuf6Lt01fFq3ilZeJfSZZY25Em2Gd3sLQ58V/Ts2phhGwPCHGJqhiRoE+HDRO7lewxzvKBgy/cqm7MKBcwU9D5q2ebF9wSYsMthuBGM+NpXqNdfmsqTk9aZ8FQ5s7GRlQwyjAC6z5cH2Mb4R51FIyy1M/zB+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621376; 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=NEwfK/eU2wdu5EsnKOCQRIJRHejP9jR1iKVyrMXHyPU=; b=X1ZwRdHS4Ad9jwa3oodzzE9C1ZEh3qvcwxU/fQiQVvfkp5i4gJBEfSqfszqvEi5f1wM6ya7G8z2W9t0VPKsxaiCKAXw1OfPTknA2hJgrknQxyRRxVcOuwoWAjdfFfpbqmp4cXvGL4clu19X5gNKNuneK6POM2Rn52uVSCwTEld4= 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+importer2=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 1711621376757230.99314931390268; Thu, 28 Mar 2024 03:22:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmts-0002QJ-5p; Thu, 28 Mar 2024 06:22: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 1rpmtn-0002Au-Tn for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:21 -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 1rpmtm-0007kO-EF for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:19 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-161-2s2_XBCYOteh0JSfVJA0DQ-1; Thu, 28 Mar 2024 06:22:14 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id ECFF629AC032; Thu, 28 Mar 2024 10:22:13 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id E948E1C060D0; Thu, 28 Mar 2024 10:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621337; 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=NEwfK/eU2wdu5EsnKOCQRIJRHejP9jR1iKVyrMXHyPU=; b=cewjBGf+KUrCigKni0FwznxM5CWN+5t1XaJaL8W5DhfpiBPPfStAy7TW/pC9F6ecNPrZJU T67GKgzcu7c4PrhxdG0vjAdOte1xgsXHfbAOtcASL5ZVAEZrKQrqomwE1MklducnQMR8B4 TrQTxPb0GXTgvV87S5Hqnq9oLe1jFWA= X-MC-Unique: 2s2_XBCYOteh0JSfVJA0DQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 07/19] hw/ahci: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:40 +0400 Message-ID: <20240328102052.3499331-8-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.7 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621378459100001 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 --- 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 bfefad2965..e89c92b7aa 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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621363; cv=none; d=zohomail.com; s=zohoarc; b=XhQ4YRaI56oeqyjPXKOV9ksIm1cRfejHYgTlm+0se3NEh12VMTImGzHh9xyOxSEM9L51tUr9wlphoUZ8vAZqnbZtrA4Kx/bZB1U+WX6tTzK3QLW55ewJwxFjByP//3AdXfktQXzzawKGk8liXF8CmHPI8XuHSDgNSaVTxCeVWwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621363; 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=brNznkesgm5sM6cu00vVLhBhhfdPMXzqKQMxNztlRXs=; b=NGjdcVmBOMdHkUSf1ZPDiuhRxN5mxhrD/K2HYWsrDgAFNehNq33XWOJkQIxQefocMatZYXtlVn9/518Xnabkn2jl0rg7YFwN/ff55MZq/OXDatjCUXb8ajdN00PY635w3R+5an1eX8reSTAcR1ewub+f8PHKXEIqDbnvDorZzKI= 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+importer2=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 171162136392785.78374226461335; Thu, 28 Mar 2024 03:22:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmtz-0003N6-97; Thu, 28 Mar 2024 06:22:31 -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 1rpmty-0003I3-9m for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:30 -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 1rpmtw-0007lD-U0 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:30 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-310-LfCy9EUyP5i1D_F6jCjsCg-1; Thu, 28 Mar 2024 06:22:23 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8021E29AC032; Thu, 28 Mar 2024 10:22:22 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0CAC492BD0; Thu, 28 Mar 2024 10:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621348; 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=brNznkesgm5sM6cu00vVLhBhhfdPMXzqKQMxNztlRXs=; b=g+3tbAEE1eQXlUgKyfL/aaQ4AcqKEy7xuB49uRwLhJs8U7PIUcn/zmgJyzdlc4MFBf6W/k ju3bEpEsr8Wb+tUpLxfse0Ovib68IWKWTbb2eNiupmOyXm78DjobkzJvsPDzS87cgXNTen sdpXYuW49QhEU/x7dTovFttVSPWVQTU= X-MC-Unique: LfCy9EUyP5i1D_F6jCjsCg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 08/19] hw/vhost-scsi: fix -Werror=maybe-uninitialized Date: Thu, 28 Mar 2024 14:20:41 +0400 Message-ID: <20240328102052.3499331-9-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.10 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621364417100001 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 --- 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 ae26bc19a4..5b066df4f7 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -170,7 +170,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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621367; cv=none; d=zohomail.com; s=zohoarc; b=TQIE3Pbd39CoCQGD/pGwEcxGt9xP4CEHuwD8wCrSVZyYncC2pDyPY0XWlmRYRfLW6MoWP4B7t6acqskD8md8RQkIfylCIjLCNbl026JJNNbxjzQ9oqTBNbXEw6u7eWCE2QV9W85EXqxzkONQs9bbbroujGAgQIN5NkkmnJ17IXw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621367; 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=Id6Tap1ND/e/Z5oRBTzfcA/u78wAx6yb1XvTTXVSj0E=; b=Atdy04GXkJORudWiVB3sXsN7ADoyuj9P/TNB7vS1Luw8cpCugmJts8Z1rZPiuxkTR2RBjMpnfrd0Wh5Hcm/QGzg3hxaSTNp5RIEQcvkCtq8rGw2MP/Vi1b+l8nUV6iSjkNOjq74oeOLgrrAmw9qffSgBopZ+QGVg23sOjPlklnM= 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+importer2=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 1711621367723731.5919361690574; Thu, 28 Mar 2024 03:22:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmu9-0004Wc-5k; Thu, 28 Mar 2024 06:22: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 1rpmu7-0004MT-RL for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:39 -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 1rpmu6-0007mC-3I for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:39 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-681-eUKddbu5MUiuhb2HPcq-hQ-1; Thu, 28 Mar 2024 06:22:32 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 333BF185A784; Thu, 28 Mar 2024 10:22:31 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4476B17AA7; Thu, 28 Mar 2024 10:22:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621357; 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=Id6Tap1ND/e/Z5oRBTzfcA/u78wAx6yb1XvTTXVSj0E=; b=i5bM2JBKQxz3Z3mwATRJZ2ecq10MmGM+YihztiRU5C9YZwZn0qD8MdfYkrecLfrPewDHyS SPMREkw+/ep8NITGPjMY5o11+uoVziOQjQyjjXTKYQOUt2M7o6mcNYSJxPmndQMsY/bxRA WmZp3yhkrPxCV5H3l461nrwDjWhPJm8= X-MC-Unique: eUKddbu5MUiuhb2HPcq-hQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 09/19] hw/sdhci: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:42 +0400 Message-ID: <20240328102052.3499331-10-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.5 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621368442100002 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 c5e0bc018b..da5351d4e5 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -745,7 +745,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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621388; cv=none; d=zohomail.com; s=zohoarc; b=WpZfI+42DUpwO6JxV69Ketn8pGP+liz69Ztr0dVLX7o9G6da5Sp1MJC0LdjPhWEzwaszNVAUBKDKdP5vnkh1RV5BZvtB3d4qXeZgOoeqcVeLm7Subs5qZ40ACvhU39TXazagseiJf39Oqid0NJPPgb7qoQ31viqQq+HkgdR3FMA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621388; 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=YLsMV3OPWyHGVz8JarPvB1XH8kzXFdChfi9w3FlmoSo=; b=EtahyjSeS+ojvC3bQsTDxYHt7Lm1QOOtmeaGT4LrmiiCwI+TYCOwA/WJE618lRBkVgStuiDUCGA+9cmx2+i3xatcS9sVKsxBZvindcyC3hMPTuL9BSFLuNqMzbKGBdCndYf0pa8tT99wbW7NVpPiP5/Je4TPC0vo91qt+wTXxzE= 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+importer2=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 1711621388455670.3290281778109; Thu, 28 Mar 2024 03:23:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmuU-0007Cb-OW; Thu, 28 Mar 2024 06:23:02 -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 1rpmuT-0006yX-Du for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:01 -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 1rpmuR-0007pH-Sy for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:01 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-66-WUgWo06zME-_6W3XydgGDA-1; Thu, 28 Mar 2024 06:22:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6700E3C02533; Thu, 28 Mar 2024 10:22:54 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49A1B3C20; Thu, 28 Mar 2024 10:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621379; 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=YLsMV3OPWyHGVz8JarPvB1XH8kzXFdChfi9w3FlmoSo=; b=W17jlInYKxXQDXqbCiAQgmwjcelJp6+MQGCqV+bV14uELMeY1uvj5QOPC1PdVaxyygGnGA LaPtnokSnu+XilxK1ppGghdz6jSDcm7AtPuYjoUnQPnwRoBVA1kZdLtdyNQUVRSmwmY6Jx qhgrcGkxObapPMwl37rJk5Mj2bhOx24= X-MC-Unique: WUgWo06zME-_6W3XydgGDA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 10/19] hw/rdma: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:43 +0400 Message-ID: <20240328102052.3499331-11-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.1 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621390524100001 From: Marc-Andr=C3=A9 Lureau ../hw/rdma/rdma_backend.c:129:8: error: =E2=80=98ne=E2=80=99 may be used un= initialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/rdma/rdma_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 6dcdfbbbe2..1ca485dd0d 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -90,7 +90,7 @@ static void clean_recv_mads(RdmaBackendDev *backend_dev) =20 static int rdma_poll_cq(RdmaDeviceResources *rdma_dev_res, struct ibv_cq *= ibcq) { - int i, ne, total_ne =3D 0; + int i, ne =3D -1, total_ne =3D 0; BackendCtx *bctx; struct ibv_wc wc[2]; RdmaProtectedGSList *cqe_ctx_list; --=20 2.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621401; cv=none; d=zohomail.com; s=zohoarc; b=gC4LCo5Z2lLAip/CeglDcUnEBZHB/JdDjhnb7K1phNTPJDQXUGJljB/ErYRnAzJf+JGQ6iEPak/P+cipX5LxtkmirHqlwLYVBfIIdUBD1cxrrK4Q2myEzbW7tEly/Sxb67BL9bozx4jxanKo7WLpQZeFjniFiXUk0QA+xzncrnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621401; 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=l0vLZIvCxAXQkQNjpsiTfM3Zgw33Bs4Dov1vg4na7ug=; b=ROUOR9q8FOwya6BJ2mEg0ctTbPD7TP/i/ZSb7CR9R5cAnmwznBU2s3ls2nkUiF5HOWzGhiiy6Lyz1t3VfTw2eegRq11+2MKJ2Mj6nAeyT1juVgNWMgpaaxN0PUYC9nOPeajcqoJvK0NboqfmmvkkIP1ZUVEVpMJEAIXreYn4clw= 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+importer2=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 1711621401845547.3155443353427; Thu, 28 Mar 2024 03:23:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmul-0007dZ-Fy; Thu, 28 Mar 2024 06:23:19 -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 1rpmud-0007W8-KC for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23: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 1rpmuc-0007qc-5e for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-53-s9kPCjWtO3mqm5T_iB-Sjw-1; Thu, 28 Mar 2024 06:23:05 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2BF78803FC7; Thu, 28 Mar 2024 10:23:03 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C599492BD7; Thu, 28 Mar 2024 10:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621388; 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=l0vLZIvCxAXQkQNjpsiTfM3Zgw33Bs4Dov1vg4na7ug=; b=heSGfaQbPw70gQ8JXa34u18VPgTbvQhcNp6kxxdQDnNXCP6tV8HHnI4Wq1ZXWPoNi6qnHt O2UrZexCyv/8qR2kai9uemLz8A9fQTkxu89uyBATEprsT6m8TAC0fT2dxnXBpd7AzJMwaU OX36cyyRQZypn4/5rh03GzUNEUBGa+0= X-MC-Unique: s9kPCjWtO3mqm5T_iB-Sjw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 11/19] migration/block: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:44 +0400 Message-ID: <20240328102052.3499331-12-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.10 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621402541100001 From: Marc-Andr=C3=A9 Lureau ../migration/block.c:966:16: error: =E2=80=98ret=E2=80=99 may be used unini= tialized [-Werror=3Dmaybe-uninitialized] Given that "cluster_size" must be <=3D BLK_MIG_BLOCK_SIZE, the previous loop is entered at least once, so 'ret' is assigned a value in all conditio= ns. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Peter Xu --- migration/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/block.c b/migration/block.c index 2b9054889a..486b1bec03 100644 --- a/migration/block.c +++ b/migration/block.c @@ -877,7 +877,7 @@ static int block_load(QEMUFile *f, void *opaque, int ve= rsion_id) uint8_t *buf; int64_t total_sectors =3D 0; int nr_sectors; - int ret; + int ret =3D -EINVAL; BlockDriverInfo bdi; int cluster_size =3D BLK_MIG_BLOCK_SIZE; =20 --=20 2.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621408; cv=none; d=zohomail.com; s=zohoarc; b=PD1ico9AHHqluK9Sv3J4ZVc6RSvjDA4eEmDFrFwPqVC6nWiv9Ml/sCE2ipzAgiStkr2r2Uai2SUFBZttJhzN/HeE2cM+NdCF3Pojnmnzoed1JVEkaG3ugkye8YWJnBY1UayF2+S9eGP7dc25y+8dCAnqJ/XgORJIKXgi3xHXYZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621408; 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=acVh+/q6KY41u8ad+OHkKnZLq8ZGC8P1uBZmJsqBzzg=; b=huj0AWuXDfFxaFVwJA0JAyzu++P15Graobb0gai1+SWWe7ocqcKOZTkBlq44/w8+2viWzdhYiVxVe1BuF5sxGFzoaRd6a72yF0asOzixELBX0vYyBiDRmMsjn4BxRdaAd8vOEAjax7vCkGIvuYjGRi/WMtppXS/YeRYMFvJOmEA= 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+importer2=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 1711621408099936.6449884632183; Thu, 28 Mar 2024 03:23:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmur-0007s8-UJ; Thu, 28 Mar 2024 06:23: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 1rpmul-0007hS-DV for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23: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 1rpmuk-0007re-1h for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:19 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-649-vAnWjIWyPIOl2o7vc8gn7w-1; Thu, 28 Mar 2024 06:23:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6151F3815EF6; Thu, 28 Mar 2024 10:23:12 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 368B01121306; Thu, 28 Mar 2024 10:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621397; 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=acVh+/q6KY41u8ad+OHkKnZLq8ZGC8P1uBZmJsqBzzg=; b=Zo+Rnlbf9eQh9Gq1OhKC1OpOQ25cLaJ7bVcbrJEoMQA4MKvapaMdCoQKo7hK12k9w6lg+f ln++iAvlASgEq+gCwkayRB96RVCeguY3wv+ItcJZwfrn4J0ixYBXdVfiM6aeLP1XWPo7Xy 6B0TEhX97Aq5gti8jBYNKR2MRbNzr0Q= X-MC-Unique: vAnWjIWyPIOl2o7vc8gn7w-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 12/19] migration: fix -Werror=maybe-uninitialized false-positives Date: Thu, 28 Mar 2024 14:20:45 +0400 Message-ID: <20240328102052.3499331-13-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.3 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621408596100001 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 1d2e85746f..22dd22922c 100644 --- a/migration/dirtyrate.c +++ b/migration/dirtyrate.c @@ -144,12 +144,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 9fe8fd2afd..412138ea94 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2247,7 +2247,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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621423; cv=none; d=zohomail.com; s=zohoarc; b=L+9qpkDrq9NMts1ea91cMpvH/Uw7oVyVTec+7X1w7yDERCre/kJaLfFk6WZpFNenG4nAOBMxczwWxD3xrzZI4C4XIaid7m9s9LI96Dp6RWnsNXzSBcrVHvv8IGi04ggzbMUuW1mJVbQu5VeOufwBU7oFUYtXyXgFqRNfn4RxVfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621423; 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=1hk5jvG8/EYb2j3QGk2f/hNpiklja/ZssR+kAbmUWj4=; b=V73AhvgAcxmt6+1smOIlJTf+YjNZWSM92mV4a3AEj96258lamAuOgfsT/DCmub5q8XUEjeN8NnMrGGDC6PsUBifObt4V61PqbHTOwofkPgc/NNNxv/xGoR+W8iJCYG5vlXpKho4pwctz581dfgEy5cWJxL96x54pP6H5LS1hums= 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+importer2=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 1711621423031237.26428950318257; Thu, 28 Mar 2024 03:23:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmuv-0008Bk-Rf; Thu, 28 Mar 2024 06:23:29 -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 1rpmuu-000880-QX for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:28 -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 1rpmut-0007sL-Dw for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:28 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-477-UAcyM3o_NOy-Ne3Ya7zLqQ-1; Thu, 28 Mar 2024 06:23:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCDA33C0244C; Thu, 28 Mar 2024 10:23:20 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 071522166B31; Thu, 28 Mar 2024 10:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621405; 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=1hk5jvG8/EYb2j3QGk2f/hNpiklja/ZssR+kAbmUWj4=; b=D2qsTCYZGX+yWBWO1OIzZ7L9TC8Vd+x2CSZL0jbtSp8QQTC6/Zbt02uM/2bYvSI72TXM6g U4qml/DCWAhVmVZ1upBl5saD4BDeuJbnvdRFaf29WQ3HDqZKmQ79NRGUA9twuXIqHoHN4a /RLuKHVet5y9eenl2iR5Ifw9gS0D0ww= X-MC-Unique: UAcyM3o_NOy-Ne3Ya7zLqQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 13/19] hw/virtio-blk: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:46 +0400 Message-ID: <20240328102052.3499331-14-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.6 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621424638100001 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 --- 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 92de315f17..ce660ff9fe 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1195,7 +1195,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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621466; cv=none; d=zohomail.com; s=zohoarc; b=N4og5oDs6khrK4fzMcrv/fIYoH9eyLfeBchDd7lLT217ti3HJPFEQXud3L9ZpzyayNPNONCst8zGCTv/urdTnsCKn6+u7am0fkrPVcndGmLlSbPN9DRpBiSDU/sjCX2JuPb73vtCJVS8VKQY52UqCD/s7M+rYhQsEs8BduO1rek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621466; 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=fgfwzow+4Jsf+TO10VCGSpO899Fz7eUuDTBoX+hINc8=; b=C8h/VeJvGoXyvzE6AUlgaOSMyPC+L+ar8UJ99X0iLVUFPvEpuXa+S8enE7G8QFj8Cq+qDNR/t31+so1tPaYoO1W7m+VdR9PmSHdrjLD8I7zH526WE03EQKrYt15aU0usuvGfWqoXhxNQNR0NSlxIUnHKI2Ueher+YaY3Uq+wSXg= 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+importer2=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 1711621466481765.0097925259407; Thu, 28 Mar 2024 03:24:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmvB-0000cY-9F; Thu, 28 Mar 2024 06:23:45 -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 1rpmv9-0000Q4-66 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23: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 1rpmv7-0007yF-PL for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:42 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-263-EPKhKRf0OAy_mJfexHTMyw-1; Thu, 28 Mar 2024 06:23:31 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id ECE011C02154; Thu, 28 Mar 2024 10:23:29 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A9B0492BC6; Thu, 28 Mar 2024 10:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621418; 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=fgfwzow+4Jsf+TO10VCGSpO899Fz7eUuDTBoX+hINc8=; b=CeMu0xjjXDD5pJNwKcY4ZiCJW9slhx0qfwThFYRBSEjlLOevPdRh8f4v5gDs4gpEH3Q6an U+IexJmfBEH0G1u1cSjcIgGctF0PaYeuThsWNFVQF3nS2isnfTckcY2q+0vaXOXtP+zvQw ycZoZCWG6pQQuzESujJmqAYPPNc21AM= X-MC-Unique: EPKhKRf0OAy_mJfexHTMyw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 14/19] plugins: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:47 +0400 Message-ID: <20240328102052.3499331-15-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.9 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621466844100002 From: Marc-Andr=C3=A9 Lureau ../plugins/loader.c:405:15: error: =E2=80=98ctx=E2=80=99 may be used uninit= ialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Pierrick Bouvier --- plugins/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/loader.c b/plugins/loader.c index 9768b78eb6..513a429c57 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -390,7 +390,7 @@ void plugin_reset_uninstall(qemu_plugin_id_t id, bool reset) { struct qemu_plugin_reset_data *data; - struct qemu_plugin_ctx *ctx; + struct qemu_plugin_ctx *ctx =3D NULL; =20 WITH_QEMU_LOCK_GUARD(&plugin.lock) { ctx =3D plugin_id_to_ctx_locked(id); --=20 2.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621465; cv=none; d=zohomail.com; s=zohoarc; b=OEApISDNt7LmAvrlC5ddAJfknJv7FoLSHVehxnkCfLZA3C1oSMEd3+wXuDDnzUFtNw51I4pUsnxpT9PrJioGZuUByok7YuWrq0TKQ0R0nTaQlTpHS7tQbSlUbDNW8JlSlBvcxtgzSE12clJ3P+D9c7iKWy+lzwpzgdvSMXwuf/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621465; 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=wk1XRuu9X3DGzJxFGHocnOKx8XCL2jR00QO4qFqvTGA=; b=LLqVIS8xIOgCjrSkM3sI+lc27MatcrYsHTkTDTAqCbhZvT34+5edaImzZRzUjGkuBZQhkoRRTStaqCmw7bgtKLblasYF7Smbq7UP619R1/6/zSWmKur/QBgfV8hWRZuI+Qha6LDOzLaFhkwD/EoE8X1wmwdfp8G4sjYwVMcp0JI= 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+importer2=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 1711621465803549.1589446769809; Thu, 28 Mar 2024 03:24:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmvC-0000g5-2p; Thu, 28 Mar 2024 06:23:46 -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 1rpmvA-0000Uz-BE for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:44 -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 1rpmv8-0007yU-Nz for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:43 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-sSAzZxhyPW6b9zPDUyChhQ-1; Thu, 28 Mar 2024 06:23:39 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id C71421C02156; Thu, 28 Mar 2024 10:23:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id F4235492BC6; Thu, 28 Mar 2024 10:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621422; 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=wk1XRuu9X3DGzJxFGHocnOKx8XCL2jR00QO4qFqvTGA=; b=iAaopNLwzm0r6x/0u+IlslFXvQzACzYY8Lx5/n5Aq15gsO3yb5Q+4g5IWGd0JXwnBBF+as 8jFWVJi3BKYhm6ev9L1FV9SCp9LyLOGN4BN9oRybxEAD0buVrpiKHcT4ohtn1Xuyx98hB1 tXOM2+nLwVZZXWZxwiVQ63ZEw55cZBQ= X-MC-Unique: sSAzZxhyPW6b9zPDUyChhQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 15/19] migration: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:48 +0400 Message-ID: <20240328102052.3499331-16-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.9 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621466841100001 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 8deb84984f..4e26bced31 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1847,7 +1847,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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621469; cv=none; d=zohomail.com; s=zohoarc; b=XKuPQWvtATKgsu2t8dC1OadZCbqHkkjOvRl3duc2jnSwr1wMMlofjvFX+ExyjrAvzXERoxA5JQkpEmG6wJu5WZd1moUALzS0USSQgUNKNw2Ftmfm0BdJEyX4g5k8XfPv9r5cFyoASLF8Eoq1eGsOcZ+cJLVXT2z5NrgdqCkC97Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621469; 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=XNL8vvRnydn7jCDetNfo6f12bNGtxUMZ0TRYkoRAnyo=; b=PFEANPAc+9YnLDOgyX/a9rg9rxCBMBn1Jo3Q9bjJslvPt0yWhTNnqmDUNRdxndUNfV/ZfwwDjPFXhdOIpgAtEOJ0dnr8oVcNo9ctSSVXVJjTRW9umI0SbD6QlANgyUWwxUePVKrXRMZmE/os7j0pUX/RLGEz/yO4hMXQDzWxC+o= 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+importer2=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 1711621469766656.4218561067458; Thu, 28 Mar 2024 03:24:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmve-0001K3-Nf; Thu, 28 Mar 2024 06:24:15 -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 1rpmvP-00018B-2s for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:02 -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 1rpmvM-000818-Ei for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:58 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-iPBfTMEtO4mDpBsoSw7A0Q-1; Thu, 28 Mar 2024 06:23:48 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7660E29AC032; Thu, 28 Mar 2024 10:23:47 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92DF6492BC8; Thu, 28 Mar 2024 10:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621432; 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=XNL8vvRnydn7jCDetNfo6f12bNGtxUMZ0TRYkoRAnyo=; b=Ik1Fp5jXEBohFkJOM4ODCyL14gdICiJx5FWhWNG0n1DYheZlxeN0hDQLpG8k23/ZegjQqL vVTOJRF51M7cCLs7i5WA/4fSyYFLRfEqQRfW2yW9ahQ9MmvOd9eeKw5bD5U3XLSCAv9IvL ZVMAJbUpzIeFGUFGa65V9jURrUKoi2M= X-MC-Unique: iPBfTMEtO4mDpBsoSw7A0Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 16/19] tests: fix -Werror=maybe-uninitialized Date: Thu, 28 Mar 2024 14:20:49 +0400 Message-ID: <20240328102052.3499331-17-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.9 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621470836100001 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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621477; cv=none; d=zohomail.com; s=zohoarc; b=JPVp65EV33kXIHiYs2zNhPgObRj5yN0+46+fwZq0SoL+09KjoqTqlYqNR+EZOkdsjYMlZH0AcGGLtc3bUxx5+jNjOaDUe/zZtgUsea8FBFP82k3b2FbWzOo3IM+jYTpnqPixsznqXWv4wV4ktVCAfq6yzxxxKgEc0Hp/sDZEsxw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621477; 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=Yq8tTYx/XLUB4Gx0moxVhK0EJnB47ElooeGni6U2KHU=; b=DIlD2OeWJykAop1wj9s43LNKodVfVFy6N8b/bZWckuIWFUPb4PtvymxfwIe/A6GA8pixUvxvtUqWn+hr9V5Lm5NdPQpYvJaPpe9jk5k2DMRMRm8NiHhft3loa37eoGphO3J/m4MRGu/f4LcLrbAe6lL9FIcwW+DYl+3ZG6ks8mM= 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+importer2=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 1711621477923346.20513911349224; Thu, 28 Mar 2024 03:24:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmvo-0001qc-2C; Thu, 28 Mar 2024 06:24: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 1rpmvm-0001ft-SO for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:22 -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 1rpmve-00081z-Ib for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:15 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668--SLuRppQOwuCV8NX8L6XsQ-1; Thu, 28 Mar 2024 06:24:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3EBF6811E81; Thu, 28 Mar 2024 10:24:10 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45E373C20; Thu, 28 Mar 2024 10:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621454; 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=Yq8tTYx/XLUB4Gx0moxVhK0EJnB47ElooeGni6U2KHU=; b=Muu9yLsCTY52Cl8uY5wFx4raKN2Zd5ttyp0m2w0ITaVBFtseRCFOgWb5mEfXt18Gqwh/1Y p5n/pMpYH5GON8rQjuBN7VJZT9jQF5YdvO8XwvJF9c+C8s2O/sTwR4LuqoztGKr7pM06px WajW3VfgEnuq6vmgZSL9Jtus4D3gXxs= X-MC-Unique: -SLuRppQOwuCV8NX8L6XsQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 17/19] hw/nvme: fix -Werror=maybe-uninitialized Date: Thu, 28 Mar 2024 14:20:50 +0400 Message-ID: <20240328102052.3499331-18-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.1 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621478823100001 From: Marc-Andr=C3=A9 Lureau ../hw/nvme/ctrl.c:6081:21: error: =E2=80=98result=E2=80=99 may be used unin= itialized [-Werror=3Dmaybe-uninitialized] It's not obvious that 'result' is set in all code paths. When &result is a returned argument, it's even less clear. Looking at various assignments, 0 seems to be a suitable default value. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index c2b17de987..127c3d2383 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -5894,7 +5894,7 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeReq= uest *req) uint32_t dw10 =3D le32_to_cpu(cmd->cdw10); uint32_t dw11 =3D le32_to_cpu(cmd->cdw11); uint32_t nsid =3D le32_to_cpu(cmd->nsid); - uint32_t result; + uint32_t result =3D 0; uint8_t fid =3D NVME_GETSETFEAT_FID(dw10); NvmeGetFeatureSelect sel =3D NVME_GETFEAT_SELECT(dw10); uint16_t iv; --=20 2.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621493; cv=none; d=zohomail.com; s=zohoarc; b=lO9IGKo0K4wmvKP5R7Ou6jZRulndZGsPZ3CHEHx8RSaQsktzLDCBetCkTc84sRC0dKNsbFKtvBn6xfHK/VQwOsLMECbePN+vLW8Zdn5EG9mA0QjNG5Uw65a+zPyJlJxndFUwsUBVzeoihFn5YtdzYXxjHPd5+PxWdN+9GShz0eE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621493; 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=ZaMpwY19pcCqO5xFBKSdLJ7yo1YyaKqcLtzVGkXev9w=; b=LlllNdGEV+lBDNHfeZLMknqM5UN7EY0lVw9ivHREYXFE+i7Ds4phB/sjDwTrRdXFlvDl1o8TKKhUE5M0X6DcCL0qq/FfDfFmR0N0yH4QxVB8lboIn5JlSPbA763KXr+BgSv/uNiWum3FHFfFt40QXee7DBl4qrxQE3uXmME/Pjg= 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+importer2=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 171162149357344.97676646722107; Thu, 28 Mar 2024 03:24:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmvv-0002yt-EI; Thu, 28 Mar 2024 06:24:31 -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 1rpmvu-0002s4-DO for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:30 -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 1rpmvs-00083l-Cb for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:30 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-439-gyoeTz-gOLi9TDKS68wy6g-1; Thu, 28 Mar 2024 06:24:20 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4091A800264; Thu, 28 Mar 2024 10:24:19 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E5681C060DC; Thu, 28 Mar 2024 10:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621467; 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=ZaMpwY19pcCqO5xFBKSdLJ7yo1YyaKqcLtzVGkXev9w=; b=Fj+r45tcqU2At9iaZWj8H9QjL1LzEA5MMsG6OcFwSqWU/ReqHIYi3bqrpUL6mttTOPdXU/ jnsJQas4D8UBhJ4TYdtdp8lWLkE7wMjdmn474Rz5y7ir574bQjHiRTBdNBc7c53+6F3BZg RolLOc9uxY1j1EMWw5nIx4rCO1OOcfU= X-MC-Unique: gyoeTz-gOLi9TDKS68wy6g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 18/19] hw/virtio: fix -Werror=maybe-uninitialized Date: Thu, 28 Mar 2024 14:20:51 +0400 Message-ID: <20240328102052.3499331-19-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.7 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621494928100001 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] '&r' is not guaranteed to be assigned when calling -Werror=3Dmaybe-uninitia= lized. Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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.44.0 From nobody Fri May 17 06:49:22 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621496; cv=none; d=zohomail.com; s=zohoarc; b=Ts5zgI3rw5uXWYwEvuAn/fTITz3KFM8VOFwYcxce1mcyM5B+dPxBwz5Qpm1taZTVNy/N3LXOYeM6DUZP4XusHF3lpEpfPM1sAynIhASQ/ClPgjgoqrlH2LZ8MuNAJUZgV04RzwvsG5Et5WCOV4lealk4haLG1KZ53xV2iQW8Wuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621496; 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=oHRMzYEm8O07qCC1WuSIUkd0l/2v6McOwpmBcpQ2w5Q=; b=PmxOjbpgPEyrkze9Sy+Wi4siagUulgaHSrDRs/D7ZSuZ4WTu2eVWOkax3uN5DwsrC3fTsbLnaEFojqBODZ0foNDdze/6QfYCJwbMPn41QjRNwRVBdIqPLNrwRhv+udKNQBmsJzaMnVqJZE+0NGQ7a4E9a83fvUV1OqBqdktLJKs= 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+importer2=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 1711621496857711.9755929473625; Thu, 28 Mar 2024 03:24:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmw1-000394-2j; Thu, 28 Mar 2024 06:24:37 -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 1rpmvz-00037s-FI for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:35 -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 1rpmvx-00084U-Rb for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:35 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-R184r4QNOt6w4r65TNpR3Q-1; Thu, 28 Mar 2024 06:24:29 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 20E8A801901; Thu, 28 Mar 2024 10:24:28 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B065492BD7; Thu, 28 Mar 2024 10:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621473; 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=oHRMzYEm8O07qCC1WuSIUkd0l/2v6McOwpmBcpQ2w5Q=; b=h4c5joO1H2Shi4UFKFcfYYkQf6wcKvSIb2twiMAozBgtVwt8vtNZ9QxFjkim1dZR4yq71a Kx6MMrFIg3TU2GqRY5IK5QMvzOQgDdenCLMx3YKJERUxWquMclEDLYU4I4J/JfPIYYlltD gVQ66RQXvCFmAusNaE5X4qDfsfCvHcY= X-MC-Unique: R184r4QNOt6w4r65TNpR3Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 19/19] RFC: hw/virtio: a potential leak fix Date: Thu, 28 Mar 2024 14:20:52 +0400 Message-ID: <20240328102052.3499331-20-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-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.11.54.10 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621498922100007 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.44.0