From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3NjP-0007a3-H5 for qemu-devel@nongnu.org; Mon, 30 Nov 2015 07:39:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3Nib-0007Ff-MH for qemu-devel@nongnu.org; Mon, 30 Nov 2015 07:38:59 -0500 Received: from mga14.intel.com ([192.55.52.115]:27774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3Nib-0007FM-FA for qemu-devel@nongnu.org; Mon, 30 Nov 2015 07:38:09 -0500 References: <1447671063-92665-1-git-send-email-guangrong.xiao@linux.intel.com> <1447671063-92665-5-git-send-email-guangrong.xiao@linux.intel.com> <20151130103227.GC4862@redhat.com> From: Xiao Guangrong Message-ID: <565C4194.2070200@linux.intel.com> Date: Mon, 30 Nov 2015 20:31:16 +0800 MIME-Version: 1.0 In-Reply-To: <20151130103227.GC4862@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v8 4/5] nvdimm acpi: build ACPI nvdimm devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: ehabkost@redhat.com, kvm@vger.kernel.org, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, rth@twiddle.net On 11/30/2015 06:32 PM, Michael S. Tsirkin wrote: > On Mon, Nov 16, 2015 at 06:51:02PM +0800, Xiao Guangrong wrote: >> NVDIMM devices is defined in ACPI 6.0 9.20 NVDIMM Devices > > Forgot to mention: > > Pls put spec info in code comments near > relevant functions, not just the log. > Sure, good to me. >> + >> +static void nvdimm_build_ssdt(GSList *device_list, GArray *table_offsets, >> + GArray *table_data, GArray *linker) >> +{ >> + Aml *ssdt, *sb_scope, *dev, *method; > > So why don't we skip this completely if device list is empty? Yes, it is exactly what we did: void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data, GArray *linker) { GSList *device_list; /* no NVDIMM device is plugged. */ device_list = nvdimm_get_plugged_device_list(); if (!device_list) { return; } nvdimm_build_nfit(device_list, table_offsets, table_data, linker); + nvdimm_build_ssdt(device_list, table_offsets, table_data, linker); g_slist_free(device_list); }