From patchwork Wed Jul 31 14:36:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 815651 Delivered-To: patch@linaro.org Received: by 2002:a5d:4acf:0:b0:367:895a:4699 with SMTP id y15csp773303wrs; Wed, 31 Jul 2024 07:37:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWYOFvXMdDPxxkpN2EJWbOKkJsuAMBuPC7S+2oE0wOsBrKinQs10SxSlwopoy37ZjC9tGxgnVFa8A5fIGn03Pzs X-Google-Smtp-Source: AGHT+IGQEjM4VQOsGfUk4WKVnxBqQSGuRdxMRCMDsSIxZfDoXxD+UVi2cHVCFNdf4AW9Ml52BLKM X-Received: by 2002:a05:620a:1a85:b0:7a2:e5f:22b6 with SMTP id af79cd13be357-7a20e5f259bmr146444885a.45.1722436660804; Wed, 31 Jul 2024 07:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722436660; cv=none; d=google.com; s=arc-20160816; b=nvWxo5AX1qv9NlQI0lhY4bm/2X3AZ6QMr67NGirdIfnVX8Mq4gSZvca7UuKbE6DRT2 RYgctUP89Eo7eDC09c/o5deG7XFVV0uFElRGx6zvEM9P1CrZKhe0lstj77u8T0bzBUK2 OWuV4/fp/1/apiPik1WKU08aJV12huZRlBbeM5TE4mV/JRf0RgCB/mE4AWyX7Aibsaov rueNBqKkCy51hzGpR4k5TnGQ2yU3nb5+52Xj5VItA0ycklNcxXtxb3ZmDJ0qA140JV+J qmw8dRnDI4RurYdN3lhWibpdcE2bjjMNIJL8+MbjkG9bQ8IkGEx+qklOt7IVC5dzykci 6YGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kb8rrJWADVvXdHvGrD9NacsP9WtS53Udc5d9elH1XfE=; fh=5quBhmNe3tsEAdid5ZAgwbHv9gtP/oew6yvM24yBrbo=; b=DUdiMVmeiIJ1/dLDNctFk3op3xiUnkZzqG2al6MDARsqpCopy0S9WKzfCve7+hnK+u qgUwMch+15zqSiZuvylJFv2cIEZNlYrzyrR8t77VPGEsM/aHv9IVt9semn19TnmiZpim Hq4L28LVL0dCeoHySOPOPtgJbiRNF+QCh/IpZ/1UMPBXMyz7noujvG3XdRjR7ugRTM6Y WUue6puTHuXDXV06kqAzb7M5YrHkoeNW+yy8FLzPZEzKgputVmMokt4DSiNND8maQuJR W0+jyad6rbs6Ag5PpFsLrBUD2ozvXs9dwX/hq4SmMuxx1S2CqhRVMCmx4WakHO/XBP5j uJ1g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=riK9jB+h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a203054152si374109185a.556.2024.07.31.07.37.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jul 2024 07:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=riK9jB+h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZARQ-0004wx-C0; Wed, 31 Jul 2024 10:36:36 -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 1sZARH-0004VI-Uo for qemu-devel@nongnu.org; Wed, 31 Jul 2024 10:36:29 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZARD-0002eY-Tb for qemu-devel@nongnu.org; Wed, 31 Jul 2024 10:36:27 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42809d6e719so38481705e9.3 for ; Wed, 31 Jul 2024 07:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722436582; x=1723041382; 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=Kb8rrJWADVvXdHvGrD9NacsP9WtS53Udc5d9elH1XfE=; b=riK9jB+hX43CTzerMc46tCM0xe5OWLgf2LyD6qTKFCPQ0v+6lJwrlJxLPpBipsKIe/ PIfg+CW1CleQ08QDnfoTtnhqzuS02iRBWFLtYrKREVeocF3ToL1CVUg/CvQSSVu+B+uk RoSl0y1kJ64My5Izas5+p7U4n7iuzyodew1cuPQ5NtE7tOfiwy7zC26hlkCQlhWiKnFQ 2c8GedKaazfs5wccxdzK70GK2YtYz7/JgzKBVMYmFfN+DuuKM4PdOlr4CbU10T227tp+ YU3bYkfpPQ8X2D78W0bTHcSyXym/guarmNf8acp4k3/cCe4CdN0dC2FtlCJ4LW/sSzB9 dXoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722436582; x=1723041382; 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=Kb8rrJWADVvXdHvGrD9NacsP9WtS53Udc5d9elH1XfE=; b=ujpHn2O+LWyfxjJxrkzXRDyJuMAMOpmeSIEsFglaG/Kx++ngh5IojXKtPbi0/oXg2j 7Hi+5/GusBaoW3GO9KEvXGEgQVtZrGR0EmunNAG5Ey49wdB0Zcghnc6Zynd3dEiC4m7k URr9Qi2ujy4AFwBpwcoXsxJyb5+x+AXPjel72Z2v+yBdMSH1ZIItRcXwV0/oofJ1nMSZ gPm3kg7SJM3oamSww1wzSraXJDa0B8bShc4XBWloJFWpyjnawsDoCLM3Y0VMj9lZBRkm S64eSblrIcos8ySokPLCS/AGiW9f+RILjSTfaWHoBzoA47frFMrgyjPFkgNqoaGBL7Br hR4w== X-Gm-Message-State: AOJu0YxtHz7U0/QfrHdCzPzJdKYjLA7gq5M7RIhkxY/pnYDsByEGLtr4 58CakdinEhEOqrYlbx0qDknZFaGmFQeZivx+ezKAVIPOC+HwpiH/eFpyMr7wkgo0M+/U1PfFaby y X-Received: by 2002:a05:600c:46cc:b0:426:5269:9838 with SMTP id 5b1f17b1804b1-42811d73f0amr94743475e9.4.1722436582479; Wed, 31 Jul 2024 07:36:22 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282b89a86dsm23976025e9.1.2024.07.31.07.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 07:36:22 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Stefan Weil , "Richard W.M. Jones" , Hanna Reitz , Kevin Wolf , qemu-block@nongnu.org Subject: [PATCH 6/7] hw/ide/pci.c: Remove dead code from bmdma_prepare_buf() Date: Wed, 31 Jul 2024 15:36:16 +0100 Message-Id: <20240731143617.3391947-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240731143617.3391947-1-peter.maydell@linaro.org> References: <20240731143617.3391947-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Coverity notes that the code at the end of the loop in bmdma_prepare_buf() is unreachable. This is because in commit 9fbf0fa81fca8f527 ("ide: remove hardcoded 2GiB transactional limit") we removed the only codepath in the loop which could "break" out of it, but didn't notice that this meant we should also remove the code at the end of the loop. Remove the dead code. Resolves: Coverity CID 1547772 Signed-off-by: Peter Maydell Reviewed-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daudé --- hw/ide/pci.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 4675d079a17..f2cb500a94f 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -266,10 +266,6 @@ static int32_t bmdma_prepare_buf(const IDEDMA *dma, int32_t limit) s->io_buffer_size += l; } } - - qemu_sglist_destroy(&s->sg); - s->io_buffer_size = 0; - return -1; } /* return 0 if buffer completed */