From patchwork Fri Dec 30 15:21:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 89391 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp6491993qgi; Fri, 30 Dec 2016 07:38:53 -0800 (PST) X-Received: by 10.200.50.147 with SMTP id z19mr38225939qta.207.1483112333418; Fri, 30 Dec 2016 07:38:53 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n72si25053339qke.243.2016.12.30.07.38.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 30 Dec 2016 07:38:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:40380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMzGe-0007D1-SC for patch@linaro.org; Fri, 30 Dec 2016 10:38:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMz0V-0002Oa-GB for qemu-devel@nongnu.org; Fri, 30 Dec 2016 10:22:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMz0U-0000IN-9A for qemu-devel@nongnu.org; Fri, 30 Dec 2016 10:22:11 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:33439) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cMz0U-0000I0-2R for qemu-devel@nongnu.org; Fri, 30 Dec 2016 10:22:10 -0500 Received: by mail-pf0-x244.google.com with SMTP id 127so12188106pfg.0 for ; Fri, 30 Dec 2016 07:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Hm8pzRaHXsjaroJkf7OCuUzDHopvurFjUOY+t/aow6E=; b=jJfMw7sNvcELJN/E89hdaRZReJfZvMcm2SlC/z1TTk0ad4NQzF+ZB3hCIBuBkyGfD2 RYCFtg0S6qQyPwuz7eWlAS5vZC0Hq9bfpZsDNcob2/1j9R0kDNzVjUMyCdqVgqXafLXb f86UwM2FbB3zDw+MXp1iUSQG1tfRhSJTefS/VEVPFe4TXkCNI0KeiZpIuVwbC0HG1U1Q LZmO+6anudQp6ef5AL91IYOplfxKrkrLruAcaLiOs26w5334MD/LWGvHkYSwR0KTEEne AVP+uROuz73LU0XS+cXRJkZjVrPo3wxGlNtrISpBDeVwaVXNPL5yP+W1NM0eitNPcgnF cV1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Hm8pzRaHXsjaroJkf7OCuUzDHopvurFjUOY+t/aow6E=; b=sGEs6Nhzd8TM2mI1JJyHB83IQJsi9lwhgQEYprOhayoFxGiiq/rGmblpLi7bLU8ibY lcMVw4Ss1y62Y/E5jE9Z13g//E4WEh9qb6CE4cr4g4rkWevl3hmsm9WEDeSYrfDM+5oi 4JotblFo+n1pKQIy3AM/iYOstvnptoY1PlWD7IggUV4jpCiUlMfaW07XJ0b1vhQadpuE WKRZ67pT16yVAfMwyFJxgq+jLYW6AQh7tHE2dbpfYxgR/Iob2ryUS+NSXUFCFYDW4ox4 IBS4gUqYbHLTd/KLQN4iYkfZDbl4pTEfqcleKlOe7N1GYqJLPNpEd7ZNfnYMqbREwZcH H5sw== X-Gm-Message-State: AIkVDXLt1lHsT8X7F3feG3UXV4qBYZMC7QZO2fyxCvuZ+PFXeRU9+DjuM6/fw4Q3/ae6Gg== X-Received: by 10.99.113.82 with SMTP id b18mr69888862pgn.118.1483111329267; Fri, 30 Dec 2016 07:22:09 -0800 (PST) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id w125sm113402870pfb.8.2016.12.30.07.22.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Dec 2016 07:22:08 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 01875A278; Fri, 30 Dec 2016 09:21:58 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 52E3E30007E; Fri, 30 Dec 2016 09:21:53 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Fri, 30 Dec 2016 09:21:44 -0600 Message-Id: <1483111310-24808-14-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483111310-24808-1-git-send-email-minyard@acm.org> References: <1483111310-24808-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH 13/19] pc: Add _enabled to the end of some boolean flags X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , minyard@acm.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Corey Minyard This makes the function of the variable more clear and avoids some conflicts in later patches. Signed-off-by: Corey Minyard --- hw/i386/pc.c | 37 +++++++++++++++++++------------------ hw/i386/pc_piix.c | 3 ++- hw/i386/pc_q35.c | 6 +++--- include/hw/i386/pc.h | 6 +++--- 4 files changed, 27 insertions(+), 25 deletions(-) -- 2.7.4 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 25e8586..56a535d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2160,46 +2160,46 @@ static void pc_machine_set_nvdimm(Object *obj, bool value, Error **errp) pcms->acpi_nvdimm_state.is_enabled = value; } -static bool pc_machine_get_smbus(Object *obj, Error **errp) +static bool pc_machine_get_smbus_enabled(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - return pcms->smbus; + return pcms->smbus_enabled; } -static void pc_machine_set_smbus(Object *obj, bool value, Error **errp) +static void pc_machine_set_smbus_enabled(Object *obj, bool value, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - pcms->smbus = value; + pcms->smbus_enabled = value; } -static bool pc_machine_get_sata(Object *obj, Error **errp) +static bool pc_machine_get_sata_enabled(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - return pcms->sata; + return pcms->sata_enabled; } -static void pc_machine_set_sata(Object *obj, bool value, Error **errp) +static void pc_machine_set_sata_enabled(Object *obj, bool value, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - pcms->sata = value; + pcms->sata_enabled = value; } -static bool pc_machine_get_pit(Object *obj, Error **errp) +static bool pc_machine_get_pit_enabled(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - return pcms->pit; + return pcms->pit_enabled; } -static void pc_machine_set_pit(Object *obj, bool value, Error **errp) +static void pc_machine_set_pit_enabled(Object *obj, bool value, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - pcms->pit = value; + pcms->pit_enabled = value; } static void pc_machine_initfn(Object *obj) @@ -2213,9 +2213,9 @@ static void pc_machine_initfn(Object *obj) pcms->acpi_nvdimm_state.is_enabled = false; /* acpi build is enabled by default if machine supports it */ pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build; - pcms->smbus = true; - pcms->sata = true; - pcms->pit = true; + pcms->smbus_enabled = true; + pcms->sata_enabled = true; + pcms->pit_enabled = true; } static void pc_machine_reset(void) @@ -2378,13 +2378,14 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pc_machine_get_nvdimm, pc_machine_set_nvdimm, &error_abort); object_class_property_add_bool(oc, PC_MACHINE_SMBUS, - pc_machine_get_smbus, pc_machine_set_smbus, &error_abort); + pc_machine_get_smbus_enabled, pc_machine_set_smbus_enabled, + &error_abort); object_class_property_add_bool(oc, PC_MACHINE_SATA, - pc_machine_get_sata, pc_machine_set_sata, &error_abort); + pc_machine_get_sata_enabled, pc_machine_set_sata_enabled, &error_abort); object_class_property_add_bool(oc, PC_MACHINE_PIT, - pc_machine_get_pit, pc_machine_set_pit, &error_abort); + pc_machine_get_pit_enabled, pc_machine_set_pit_enabled, &error_abort); } static const TypeInfo pc_machine_info = { diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5e1adbe..3bfe464 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -235,7 +235,8 @@ static void pc_init1(MachineState *machine, /* init basic PC hardware */ pc_basic_device_init(isa_bus, pcms->gsi, &rtc_state, true, - (pcms->vmport != ON_OFF_AUTO_ON), pcms->pit, 0x4); + (pcms->vmport != ON_OFF_AUTO_ON), pcms->pit_enabled, + 0x4); pc_nic_init(isa_bus, pci_bus); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index d042fe0..5f67c45 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -227,13 +227,13 @@ static void pc_q35_init(MachineState *machine) /* init basic PC hardware */ pc_basic_device_init(isa_bus, pcms->gsi, &rtc_state, !mc->no_floppy, - (pcms->vmport != ON_OFF_AUTO_ON), pcms->pit, + (pcms->vmport != ON_OFF_AUTO_ON), pcms->pit_enabled, 0xff0104); /* connect pm stuff to lpc */ ich9_lpc_pm_init(lpc, pc_machine_is_smm_enabled(pcms)); - if (pcms->sata) { + if (pcms->sata_enabled) { /* ahci and SATA device, for q35 1 ahci controller is built-in */ ahci = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_SATA1_DEV, @@ -253,7 +253,7 @@ static void pc_q35_init(MachineState *machine) ehci_create_ich9_with_companions(host_bus, 0x1d); } - if (pcms->smbus) { + if (pcms->smbus_enabled) { /* TODO: Populate SPD eeprom data. */ smbus_eeprom_init(ich9_smb_init(host_bus, PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC), diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index b22e699..f165f69 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -63,9 +63,9 @@ struct PCMachineState { AcpiNVDIMMState acpi_nvdimm_state; bool acpi_build_enabled; - bool smbus; - bool sata; - bool pit; + bool smbus_enabled; + bool sata_enabled; + bool pit_enabled; /* RAM information (sizes, addresses, configuration): */ ram_addr_t below_4g_mem_size, above_4g_mem_size;