From nobody Mon Feb 9 00:56:43 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=1610224535; cv=none; d=zohomail.com; s=zohoarc; b=JSboRGJRBXb5+6ah/FIAHcnkKa0GlatPHtukE2d5mLYbmvrz7qlZDjqEeFR1w1dJiaCcn+Eb4R8WJXuCbqWYkLZ4RUvhHEGezMBL3GR8nErMEk0Nn9latUb01/203i+5D62vs1hgLBQfAcNyEOYKwlmXrZfuThsMBN2vQgwleCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610224535; 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=L9tom7/nkf36H79A3BwCSvP2xIV7MmmqY7ZTbjet7YA=; b=dmamxTP7VZaIDSY4qESsMFpluHLoGGQVAJ5A4e9Ta/5+tuJxXlusCySvSf2ztRrDfut5ys41Y+PDLXx7fJSsLuPv3RlBDUBHwKnBQU7iplSp092SEUgtWSUXokw4cOVnD7a43ROFGBlSaxu2aZS3QCxXky+P1jNFipHPQpxjWbc= 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 1610224535709247.0302468211902; Sat, 9 Jan 2021 12:35:35 -0800 (PST) Received: from localhost ([::1]:50538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyKxS-00054D-CS for importer@patchew.org; Sat, 09 Jan 2021 15:35:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyKsR-0008Vj-Gy for qemu-devel@nongnu.org; Sat, 09 Jan 2021 15:30:23 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:33416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyKsL-0007Ee-45 for qemu-devel@nongnu.org; Sat, 09 Jan 2021 15:30:21 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 5407A74760C; Sat, 9 Jan 2021 21:30:05 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 72BDE74760B; Sat, 9 Jan 2021 21:29:57 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v2 07/13] vt82c686: Simplify vt82c686b_realize() Date: Sat, 09 Jan 2021 21:16:36 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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" 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 c257926579..58c0bba1d0 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