From patchwork Thu Jul 25 16:48:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 814368 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp480604wrn; Thu, 25 Jul 2024 09:49:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXqU7C5vadiU7Ga0mAJVVbErvwom0FNMzXc6G0IUvhKPgGakVumGoUqe8krtLQwSO6ACZJq62KlwwvnECjHlunq X-Google-Smtp-Source: AGHT+IG9iMC9VgxhbO5/N60TszBPg3z88DGCPTAxdkAUeCL3s/Le3wCAQ++SePkIxwkPArZLEc9Y X-Received: by 2002:a05:620a:408d:b0:79f:bd7:d24b with SMTP id af79cd13be357-7a1ccb21962mr1018726485a.7.1721926176553; Thu, 25 Jul 2024 09:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721926176; cv=none; d=google.com; s=arc-20160816; b=y/1IoEBou/hlVyO6DNwLrctRHmyF73uvhNdyLbq3pLcqcaPt1KHo5YMlA1y3R8XpDO VLeiSpPtTvFenpM6RC840REHSK34icVQB0k2GF/wRFEB+iERKI2QIz/L9C9GYRi6sXI2 OJmqRNE2fByLXsz2rWhvT1GxiyaUnTouiqJmrEkS8/oSk2rQk/JWduFZCX/jNKn9KBvj XWQQbMNtJ7kx5lnjmygf4dUvVmqlj902SotsuGzJ/70B+cKYQu/40Gg3nDlTkue7Y3Fk OkHmLRVoWPKHNXdaplcbDtj05DfCp5od4YEc4tqTgeq/j2n9UGF2A66fsW2fnTz7ofot m05A== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=LfWAFPsC7N3rrME45NZOd2dUXZkhdvT7AY8cGau49bU=; fh=Gx9DtyNvQGBGx72Z12no3KggLYwBGD0Je53Cblw8uQs=; b=i59EgLMlG4kWwhN8zjdokLCpbK7A9UtVKdNa9vto2TQBTkfTpu5Hn5/2BvGpTK4wCg jQ9AY1KefbM36Dw5/RIVCvxDRxrvc7fPNgwZ7zZnnqbXDfTUVMNwAeTq3nYagVxBoY6H OukEFKqm8u4kQmJ7XipwFASyAug0ap2tz52WJFmVT3jQ9g4mT1qTspJcJXhHFLkV4Ot9 E3YyqI2wOHHqWlTbAlHU6nwvGtIfRkvjuiYXqAI54GeWJ6+XiUfkYYgrhkOxDxUBZrH0 pESV/VzG8Q8O5bNN0HJ52WRWYjB7cKRLZ421vOKhTyP8NGpJ2H2nQmE8YUk9irrFmIvZ 8xpw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SRaPYG5v; 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-7a1d739bb36si193221085a.71.2024.07.25.09.49.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jul 2024 09:49:36 -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=SRaPYG5v; 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 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) 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-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) 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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); } g_string_append(line, "\n");