From nobody Sun Nov 24 11:13:04 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=szczek.dev ARC-Seal: i=1; a=rsa-sha256; t=1724194380; cv=none; d=zohomail.com; s=zohoarc; b=Qqv6uSZwLO3uBvVTx7RtX5pZKGocfRf7938KasZEgWwdDYfF4bQtgn8RojPQsaINO+zOpH4v0KdpHFu+8CjGqvcmWM3iP8ZgqTCDZ3LzWVgBVdwI9TJ2O1pjT29v4iCoXnV1pyDYLlFrv03Mjm7eUFIHBo8wZxFWFwswuSweggk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724194380; h=Content-Type: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=aCtHMdfzBtkQ+jo/s2WUPwOCw/uVA70giOODpNrTYUc=; b=XrCTB2KVKI3T5qFC4Xc7pSY5XfSaBSYn+lK5S40+8Lfc860KhNZdaVWTp/9LfMXvIY1z8bWlv2yiMEfxR9gbVZXW3vqbNnzoz8niJG1zjq/GZ4RpHh9I0BJw+lkyX2BERynwZ1kxjJ177FY/fq6RpTsTAwSCDxQqzOrEEra+S/4= 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 1724194380440302.6557199803275; Tue, 20 Aug 2024 15:53:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgXi9-00046H-Ac; Tue, 20 Aug 2024 18:52: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 1sgXi5-000456-M1 for qemu-devel@nongnu.org; Tue, 20 Aug 2024 18:52:18 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgXi2-0001hR-0j for qemu-devel@nongnu.org; Tue, 20 Aug 2024 18:52:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szczek.dev; s=protonmail; t=1724194327; x=1724453527; bh=aCtHMdfzBtkQ+jo/s2WUPwOCw/uVA70giOODpNrTYUc=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=QMu88Tt17Lz6H5GHPpLELCfyqJxe9QCPJdw/0TRDZ38C7aDdtItSNV1BM60OD1bhW jGknHEwB+9q/4L92tuQqDhpPFemE1dpNDCGM7XaX8bPSsS04C0p7GSj8XLPRHa2wHu VScjNuGB6pC47lH9jyj1sJNYWgu4/dXaq/pfN6kV4SoCrtmbJSgqX5Mrh51TqWZWzc eKYEX7ryvPlTpwb5keCtaEVJK2Auwv47yE/DyZzSVI5aKUXlcqFZt+KCWbHa0t8obQ laxSvpxHjLeH1rVyhwaFNq1KU65P91oPIQIs291cfz+e6SlM7ms7dZ/aAiy4TW3gFd eIDWlI27Qac2Q== Date: Tue, 20 Aug 2024 22:52:05 +0000 To: "qemu-devel@nongnu.org" From: =?utf-8?Q?Kamil_Szcz=C4=99k?= Cc: =?utf-8?Q?Philippe_Mathieu-Daud=C3=A9?= , Bernhard Beschow , Richard Henderson Subject: [PATCH] hw/i386/pc: Fix enum value assertion Message-ID: Feedback-ID: 37679334:user:proton X-Pm-Message-ID: 4ab8994b27a5a1a2790ffa1d289d2b4dc0b5d0cb 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=185.70.40.136; envelope-from=kamil@szczek.dev; helo=mail-40136.proton.ch 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @szczek.dev) X-ZM-MESSAGEID: 1724194384358116600 Content-Type: text/plain; charset="utf-8" Coverity reported: >>> CID 1559533: Integer handling issues (CONSTANT_EXPRESSION_RESULT) >>> "pcms->vmport >=3D 0" is always true regardless of the values of >>> its operands. This occurs as the logical first operand of "&&". Signed-off-by: Kamil Szcz=C4=99k Reported-By: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7779c88a91..523dfe3f3f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1221,7 +1221,7 @@ void pc_basic_device_init(struct PCMachineState *pcms, isa_realize_and_unref(pcms->pcspk, isa_bus, &error_fatal); } - assert(pcms->vmport >=3D 0 && pcms->vmport < ON_OFF_AUTO__MAX); + assert(pcms->vmport < ON_OFF_AUTO__MAX); if (pcms->vmport =3D=3D ON_OFF_AUTO_AUTO) { pcms->vmport =3D (xen_enabled() || !pcms->i8042_enabled) ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON; -- 2.45.0