Received: from eggs.gnu.org ([2001:4830:134:3::10]:46651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3kcv-0008Jy-AL for qemu-devel@nongnu.org; Tue, 01 Dec 2015 08:05:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3kcs-0004dE-4X for qemu-devel@nongnu.org; Tue, 01 Dec 2015 08:05:49 -0500 Date: Tue, 1 Dec 2015 14:05:32 +0100 From: Igor Mammedov Message-ID: <20151201140532.340805f8@nial.brq.redhat.com> In-Reply-To: <565D95F8.5040805@huawei.com> References: <1447680189-2128-1-git-send-email-shannon.zhao@linaro.org> <1447680189-2128-4-git-send-email-shannon.zhao@linaro.org> <20151201124127.1045c90c@nial.brq.redhat.com> <565D95F8.5040805@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 3/8] hw/arm/virt-acpi-build: Add power button device in ACPI DSDT table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao Cc: wei@redhat.com, peter.maydell@linaro.org, graeme.gregory@linaro.org, mst@redhat.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com, qemu-arm@nongnu.org, shannon.zhao@linaro.org On Tue, 1 Dec 2015 20:43:36 +0800 Shannon Zhao wrote: > Hi Igor, > > On 2015/12/1 19:41, Igor Mammedov wrote: > > On Mon, 16 Nov 2015 21:23:04 +0800 > > shannon.zhao@linaro.org wrote: > > > >> > From: Shannon Zhao > >> > > >> > Add power button device in ACPI DSDT table. > >> > > >> > Signed-off-by: Shannon Zhao > >> > Signed-off-by: Shannon Zhao > >> > Reviewed-by: Wei Huang > >> > Tested-by: Wei Huang > >> > --- > >> > hw/arm/virt-acpi-build.c | 13 +++++++++++++ > >> > 1 file changed, 13 insertions(+) > >> > > >> > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > >> > index bf6b934..b25c90b 100644 > >> > --- a/hw/arm/virt-acpi-build.c > >> > +++ b/hw/arm/virt-acpi-build.c > >> > @@ -340,6 +340,18 @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap, > >> > aml_append(scope, dev); > >> > } > >> > > >> > +static void acpi_dsdt_add_power_button(Aml *scope) > >> > +{ > >> > + Aml *dev = aml_device("PWRB"); > >> > + aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C0C"))); > >> > + aml_append(dev, aml_name_decl("_ADR", aml_int(0))); > >> > + aml_append(dev, aml_name_decl("_UID", aml_int(0))); > >> > + Aml *method = aml_method("_STA", 0); > >> > + aml_append(method, aml_return(aml_int(0x0F))); > >> > + aml_append(dev, method); > > since _STA always returns 0xF you can just drop it altogether, > > as _STA == 0xF is implied if it's not present. > > > > Yes, but I think adding this is harmless and make the return value explicit. It's useless and consumes several bytes, it's better to drop it unless you have to have it. > Thanks,