From nobody Mon Feb 9 07:26:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=eik.bme.hu ARC-Seal: i=1; a=rsa-sha256; t=1609968795; cv=none; d=zohomail.com; s=zohoarc; b=UMl/EKiMx+9sNJ1yFtz5CXOqAUXdxaQupmpP5/hP5hENKUfRjhLsJtMp1Zyt9yP7DEzT/v5V1N9YIJuCxFzQfriNJwjoGVVbybqvwbZpP+rOVkCuaQ9q2/05OISapNU/JEdiIS5HRgYqSE+PQl0r5e9nhmzqde21gr49+p9YFtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609968795; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=J1q9ZzVGiJZ0jeoTwYkA42SLZ27S1TCohi/k90ksUGo=; b=EPapzs9jCHz5RKMQvVTCmvhX00pa/tH4p33G5y2pXe3reGYpU5AZvbyjm05dNVEdY03M++WuK1SbDscvEAGeTc3IVGaLDvPApbAowpyj+ywkhExeZmahWNybihFcqIOgM869jX6WSzi/zqwCMESQ6oIvGM+n/cgGz5ADsyLjDJs= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16099687950274.2404211167252015; Wed, 6 Jan 2021 13:33:15 -0800 (PST) Received: from localhost ([::1]:50320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxGQb-0007lt-TA for importer@patchew.org; Wed, 06 Jan 2021 16:33:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxGMT-0002os-AP for qemu-devel@nongnu.org; Wed, 06 Jan 2021 16:28:57 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]:22469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxGMP-0001jO-S1 for qemu-devel@nongnu.org; Wed, 06 Jan 2021 16:28:57 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id A8AE27470F6; Wed, 6 Jan 2021 22:28:51 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 333DE7470F7; Wed, 6 Jan 2021 22:28:51 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 06/12] vt82c686: Simplify vt82c686b_realize() Date: Wed, 06 Jan 2021 22:13:58 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org X-Spam-Probability: 8% 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=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Huacai Chen , f4bug@amsat.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Remove unneeded variables and setting value to 0 on zero initialised data and replace check for error with error_fatal. Rationalise loop that sets PCI config header fields read only. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/vt82c686.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index a989e29fe5..ead60310fe 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -363,24 +363,16 @@ static void vt82c686b_isa_reset(DeviceState *dev) static void vt82c686b_realize(PCIDevice *d, Error **errp) { VT82C686BISAState *s =3D VT82C686B_ISA(d); - uint8_t *pci_conf; + DeviceState *dev =3D DEVICE(d); ISABus *isa_bus; - uint8_t *wmask; int i; =20 - isa_bus =3D isa_bus_new(DEVICE(d), get_system_memory(), - pci_address_space_io(d), errp); - if (!isa_bus) { - return; - } - - pci_conf =3D d->config; - pci_config_set_prog_interface(pci_conf, 0x0); + isa_bus =3D isa_bus_new(dev, get_system_memory(), pci_address_space_io= (d), + &error_fatal); =20 - wmask =3D d->wmask; - for (i =3D 0x00; i < 0xff; i++) { - if (i <=3D 0x03 || (i >=3D 0x08 && i <=3D 0x3f)) { - wmask[i] =3D 0x00; + for (i =3D 0; i < PCI_CONFIG_HEADER_SIZE; i++) { + if (i < PCI_COMMAND || i >=3D PCI_REVISION_ID) { + d->wmask[i] =3D 0; } } =20 --=20 2.21.3