From nobody Sat Dec 21 15:49:38 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1712740614; cv=none; d=zohomail.com; s=zohoarc; b=Ov+xD/UbK3Fu3IuJMfDL4W27miIWJgzD3b/gu/12n4qeDqejyysj1TAFp/o5+58LBQAShUthx1XG7EefHLAYigM8kqwdT1WHZqqPs105RwR8IZPZNkAV8VnIGlKp8qpdBlAPPK/qCkDycD3kZ0CVzZxPmZW6hsxL1xHpW55G4VQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712740614; 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=Na6FzHvKUI8XfFFB8KxCEL6XESOoupUckFCQxyDkVbo=; b=SJrTPylZJ60B4vyfReHKp+NgmToJGxkz6iG8RTnpdZ5SUGJjwxBcux9uWfs4NNpvRioljfMhpqTEsfhsNRz47fHuz7WNklQU5+hrp2O/FA/2QDkSP7p67s/icENAfXqzglncUCxPpBeFAvTz8o+4tK/6wUxBBPj66B9/5IB0lB8= 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 1712740614613300.54015968979513; Wed, 10 Apr 2024 02:16:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruU3Z-00088p-NW; Wed, 10 Apr 2024 05:15:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruU36-0007CL-7a for qemu-devel@nongnu.org; Wed, 10 Apr 2024 05:15:20 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruU34-0005tT-Eu for qemu-devel@nongnu.org; Wed, 10 Apr 2024 05:15:19 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a51fd94c0bfso187440066b.2 for ; Wed, 10 Apr 2024 02:15:16 -0700 (PDT) Received: from m1x-phil.lan (arl95-h02-176-184-34-173.dsl.sta.abo.bbox.fr. [176.184.34.173]) by smtp.gmail.com with ESMTPSA id gc7-20020a170906c8c700b00a51a259fa60sm6663631ejb.118.2024.04.10.02.15.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Apr 2024 02:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712740515; x=1713345315; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Na6FzHvKUI8XfFFB8KxCEL6XESOoupUckFCQxyDkVbo=; b=CMYlsvtCvDYq9A/m43Vku9lQSFzOUckJyexGmzPDAQ8FD2Y6uYCY0KIkavKxVU4Stl BQjpWT8S1V5NTSYIhQggKLA5eOl864AIahfcXfS2Dr4XvmYBCaxdkjnY7cNJsQtap3Qt 2VnYXEbD7viYQJEO0B5EB/Du3oSEWYvKaAJ8zctzim68YPT/QxoSCDJKQlDQrxCDXuDx JsWdPB6UizHS1iOa2TMzDSjd7NeKl3uaM6tHxixtxL+syImVYDi4z0RwKbZAKYU7X9V7 rh5KS3jibBCUIN/bD8A3h7yQxJ7dZpbdUO193zm6QRjobNpJXXqpHgefVtjLaqH9fqN3 sB6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712740515; x=1713345315; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Na6FzHvKUI8XfFFB8KxCEL6XESOoupUckFCQxyDkVbo=; b=ma49Y2h7+0+V6OgyT4Wjl/JmsyTPsBjJRbzmDlC0vZSvHhYzt35hfXWfCNcxL9766b LlXFxl1yN7+D3YlyGJlRAS6nIy/AvBL5ETDKFuvHbhEQMpPfIOW0+FLKj/HQC4LVKFeX bdH4yixZTZVa7YOXMdTWkCApA5aJw2mEzrZQ2Ean8BwZOBnBSkLpC9+GoObvGCTe6TP2 r/DDy4YPe2tUnmEPllv3B0KLodDuQxhZ0TQw9ANXJ3Jlw6WeKfNovR32maRwuXljMqVA iVqYuxIkeinOtRnHRyVWtyYq5kP94AM914Rkr2vZqCiHOy3w09sXP6pnS67Xj9PhOtAj u59A== X-Gm-Message-State: AOJu0YyWRJV5Sp7OexxGv2jlVjiUb+9PEuid8PFXEKk2rEoFqFtD7x0k UdezXV+Ub4Ek9lbp2n2wwyFoW3TF+gW7KLN5ME84T3g95IGEtGzhzUlVUGf4e9QZXtuLNxKWTsz L X-Google-Smtp-Source: AGHT+IHk1nu8hUSLKRx/Z3Dk0Mwte37YIBjOnzOZidEzFOKOcz8uDPWOFi3rZyObr56MxO1UjPzxug== X-Received: by 2002:a17:906:e288:b0:a52:a3a:3959 with SMTP id gg8-20020a170906e28800b00a520a3a3959mr1044618ejb.23.1712740515544; Wed, 10 Apr 2024 02:15:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gerd Hoffmann , "Michael S. Tsirkin" Subject: [PULL 16/16] hw/audio/virtio-snd: Remove unused assignment Date: Wed, 10 Apr 2024 11:13:15 +0200 Message-ID: <20240410091315.57241-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240410091315.57241-1-philmd@linaro.org> References: <20240410091315.57241-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1712740615815100001 Coverity reported: >>> CID 1542933: Code maintainability issues (UNUSED_VALUE) >>> CID 1542934: Code maintainability issues (UNUSED_VALUE) >>> Assigning value "NULL" to "stream" here, but that stored value is overwritten before it can be used. Simply remove the unused assignments. Resolves: Coverity CID 1542933 Resolves: Coverity CID 1542934 Fixes: 731655f87f ("virtio-snd: rewrite invalid tx/rx message handling") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Message-Id: <20240410053712.34747-1-philmd@linaro.org> --- hw/audio/virtio-snd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c index 90d9a2796e..c80b58bf5d 100644 --- a/hw/audio/virtio-snd.c +++ b/hw/audio/virtio-snd.c @@ -885,7 +885,9 @@ static void virtio_snd_handle_tx_xfer(VirtIODevice *vde= v, VirtQueue *vq) } trace_virtio_snd_handle_tx_xfer(); =20 - for (VirtIOSoundPCMStream *stream =3D NULL;; stream =3D NULL) { + for (;;) { + VirtIOSoundPCMStream *stream; + elem =3D virtqueue_pop(vq, sizeof(VirtQueueElement)); if (!elem) { break; @@ -964,7 +966,9 @@ static void virtio_snd_handle_rx_xfer(VirtIODevice *vde= v, VirtQueue *vq) } trace_virtio_snd_handle_rx_xfer(); =20 - for (VirtIOSoundPCMStream *stream =3D NULL;; stream =3D NULL) { + for (;;) { + VirtIOSoundPCMStream *stream; + elem =3D virtqueue_pop(vq, sizeof(VirtQueueElement)); if (!elem) { break; --=20 2.41.0