From nobody Mon Sep 16 18:49:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1721926177; cv=none; d=zohomail.com; s=zohoarc; b=kxj9Suaqk6RUWSBUJRecNHnE6XpI1iWNX45a2Tm8U8f/3aDb2cdcHCSNewC9R74kHI3a0w+EA0rUEh5yuv5DSQaT+tnIf1d8BmgAnT0f5zK0rdxSMvt82dN8pCU2rAig8D0aydKgo/WGIzWADg+n7KtrCnSxIqxdC7BhUGfK3Q4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721926177; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LfWAFPsC7N3rrME45NZOd2dUXZkhdvT7AY8cGau49bU=; b=LovFKlcONniLpj26EyKwWTNQnfvrPDFnMuPieLoCLrT9AH7pq5M8jwNMq+la5X45TIGFw088BRipRe1PpYDofVyj8XVtS3j14ZOPQnb81wSmyaKhS6GXrynfh5A4UCWG3Ew6/RrvmoXWnxcPfrj9M3y48kDPqIqh/fa6TIF25iA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721926177498583.6629429883491; Thu, 25 Jul 2024 09:49:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sX1eE-0002Sm-L4; Thu, 25 Jul 2024 12:48:58 -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 1sX1eC-0002Rd-Cv for qemu-devel@nongnu.org; Thu, 25 Jul 2024 12:48:56 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sX1eA-00021R-If for qemu-devel@nongnu.org; Thu, 25 Jul 2024 12:48:56 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3685b9c8998so606535f8f.0 for ; Thu, 25 Jul 2024 09:48:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b367c0889sm2764360f8f.22.2024.07.25.09.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 09:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721926133; x=1722530933; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LfWAFPsC7N3rrME45NZOd2dUXZkhdvT7AY8cGau49bU=; b=SRaPYG5vgtTWo2f706hQVOQjD8gu58ieASd1BtDLT3MLyc9fu26KuEl0uDBxJx73MV XdV3CHOOi2SrR9nBupoXEpyAYZ/ZGEfUfp1y24yaAuSsHmCWLl/BdqniJ0Fp74ictci+ ktgpZqUxSPhedb02syE6XiFnr/XFpzden5o7Jb92eLKSzCpbRtjxpFgcdSX5Vf51ey3M ITtpotqbPDQ9AozuMx48blHfeygwfxpYC/YEzWyHFXuJI2fWo7vmGKNsqyVvbkcqK3p5 O/ySsWph9czQ7j/bz6cMjk/WU7HR+cUSSc6PIMQc2wYLTtN454Th/dDicWfEf7Brzv9t 8ajw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721926133; x=1722530933; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LfWAFPsC7N3rrME45NZOd2dUXZkhdvT7AY8cGau49bU=; b=KPCI+7DHCK2R+JKHHVc8Q9VqtprUPGpOVyvgvY1i2b9z6SyeucOv4R/e/DCjqvMF+G RGC8oTPMeDCAwSx8AP3OvV3UdElh1PO5OABdfNcuk3pFKwlB/3iFV1sIUxmh805c7K9i 9YtdAHgPL5kgamxkWXYpx7M6TvR6N3H/V/fdUVjnODWWrPO8MTIK5x76POelAlrYbx9y JcdCWYXzFtd+OyrrBNgH6S51nXyYWFdkWOy3kAwPVUjONXyOhZ6YXgEeKFuMY0fQiz67 ItEidwBL0MmchRPFYDERUw22L9/xwWSlXfQYYpBTm+kaer0z1GD1TgOZWa1MXjeSj0yN GKVw== X-Gm-Message-State: AOJu0YwbKtj5P7+YynMcUiTBkT2HiPxOGrqg7GvHPtSgeR7HQlkGESA0 P7QFA4pafLipZQcUI2O7kk+URgZqdfMGzcab4jrjFaPRsKg9CyGY3OtvYEsGtISpSEhuifWIxvT a X-Google-Smtp-Source: AGHT+IHyRSopSDhypE0XDyDU9VX3ltvoWxBWuLv5fCxSB/WVwmvett32o3Anm/FMULkamJsPQsr20A== X-Received: by 2002:adf:a348:0:b0:368:41bd:149b with SMTP id ffacd0b85a97d-36b319fadf0mr2479687f8f.34.1721926132590; Thu, 25 Jul 2024 09:48:52 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier Subject: [PATCH] contrib/plugins/cache.c: Remove redundant check of l2_access Date: Thu, 25 Jul 2024 17:48:51 +0100 Message-Id: <20240725164851.1930964-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1721926179053116600 Content-Type: text/plain; charset="utf-8" In append_stats_line(), we have an expression l2_access ? l2_miss_rate : 0.0 But this is inside an if (l2_access && l2_misses) { ... } block, so Coverity points out that the false part of the ?: is dead code. Remove the unnecessary test. Resolves: Coverity CID 1522458 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- contrib/plugins/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index c5c8ac75a9c..512ef6776b7 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -558,7 +558,7 @@ static void append_stats_line(GString *line, " %-12" PRIu64 " %-11" PRIu64 " %10.4lf%%", l2_access, l2_misses, - l2_access ? l2_miss_rate : 0.0); + l2_miss_rate); } =20 g_string_append(line, "\n"); --=20 2.34.1