From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v2 04/11] acpi: add aml_concatenate() Date: Sun, 14 Feb 2016 13:55:24 +0800 Message-ID: <56C016CC.5090007@linux.intel.com> References: <1452624610-46945-1-git-send-email-guangrong.xiao@linux.intel.com> <1452624610-46945-5-git-send-email-guangrong.xiao@linux.intel.com> <20160208115103.00dc44db@nial.brq.redhat.com> <56C01635.6090501@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: pbonzini@redhat.com, gleb@kernel.org, mtosatti@redhat.com, stefanha@redhat.com, mst@redhat.com, rth@twiddle.net, ehabkost@redhat.com, dan.j.williams@intel.com, kvm@vger.kernel.org, qemu-devel@nongnu.org To: Igor Mammedov Return-path: Received: from mga11.intel.com ([192.55.52.93]:7975 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbcBNGDV (ORCPT ); Sun, 14 Feb 2016 01:03:21 -0500 In-Reply-To: <56C01635.6090501@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/14/2016 01:52 PM, Xiao Guangrong wrote: > > > On 02/08/2016 06:51 PM, Igor Mammedov wrote: >> On Wed, 13 Jan 2016 02:50:03 +0800 >> Xiao Guangrong wrote: >> >>> It will be used by nvdimm acpi >>> >>> Signed-off-by: Xiao Guangrong >>> --- >>> hw/acpi/aml-build.c | 14 ++++++++++++++ >>> include/hw/acpi/aml-build.h | 1 + >>> 2 files changed, 15 insertions(+) >>> >>> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c >>> index 97c9efb..421dd84 100644 >>> --- a/hw/acpi/aml-build.c >>> +++ b/hw/acpi/aml-build.c >>> @@ -1440,6 +1440,20 @@ Aml *aml_alias(const char *source_object, const char *alias_object) >>> return var; >>> } >>> >>> +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefConcat */ >>> +Aml *aml_concatenate(Aml *source1, Aml *source2, Aml *target) >>> +{ >>> + Aml *var = aml_opcode(0x73 /* ConcatOp */); >>> + aml_append(var, source1); >>> + aml_append(var, source2); >>> + >>> + if (target) { >>> + aml_append(var, target); >>> + } >> target is not an optional, pls looks at aml_add and use >> helper to make patch correct and smaller >> > > Indeed, i will change it to: > > /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefConcat */ > Aml *aml_concatenate(Aml *source1, Aml *source2, Aml *target) > { > return build_opcode_2arg_dst(0x73 /* ConcatOp */, arg1, arg2, dst); > } > And make a assert for @target to ensure it can not be NULL.