From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v4 10/21] acpi/table: Introduce acpi_table_get_entry_madt to get specified entry Date: Mon, 25 Jan 2016 08:02:23 -0700 Message-ID: <56A6470F02000078000CAB3B@prv-mh.provo.novell.com> References: <1453540813-15764-1-git-send-email-zhaoshenglong@huawei.com> <1453540813-15764-11-git-send-email-zhaoshenglong@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1453540813-15764-11-git-send-email-zhaoshenglong@huawei.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Shannon Zhao Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, peter.huangpeng@huawei.com, xen-devel@lists.xen.org, julien.grall@citrix.com, stefano.stabellini@citrix.com, shannon.zhao@linaro.org List-Id: xen-devel@lists.xenproject.org >>> On 23.01.16 at 10:20, wrote: > From: Shannon Zhao > > This function could get the specified index entry of MADT table. This > would be useful when it needs to get the contens of the entry. > > Cc: Jan Beulich > Signed-off-by: Shannon Zhao Again - if this is the counterpart to a Linux side change, please name that change. If it isn't, besides needing a better explanation of why you need it whether neither Linux nor x86 Xen does is needed, and a few code issues would need to be addressed too: Pointer type function parameters should be constified as much as possible, use of plain int should be avoided unless you truly need a signed type, and ... > +struct acpi_subtable_header * __init > +acpi_table_get_entry_madt(enum acpi_madt_type id, unsigned int entry_index) > +{ > + struct acpi_table_header *table_header = NULL; > + > + acpi_get_table(ACPI_SIG_MADT, acpi_apic_instance, &table_header); > + if (!table_header) { ... you should use the return value of the function instead of pre- setting table_header to NULL and then checking whether it changed. Jan