Re: [PATCH v4 1/3] nvdimm acpi: introduce fit buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 11/03/2016 06:00 PM, Stefan Hajnoczi wrote:
On Thu, Nov 03, 2016 at 11:51:28AM +0800, Xiao Guangrong wrote:
+static void nvdimm_init_fit_buffer(NvdimmFitBuffer *fit_buf)
+{
+    fit_buf->fit = g_array_new(false, true /* clear */, 1);
+}
+
+static void nvdimm_build_fit_buffer(NvdimmFitBuffer *fit_buf)
+{
+    g_array_free(fit_buf->fit, true);
+    fit_buf->fit = nvdimm_build_device_structure();

In the previous revision I pointed out that it's messy to inline
g_array_new(false, true /* clear */, 1) in nvdimm_init_fit_buffer() when
the data structure is normally created by
nvdimm_build_device_structure().  You didn't respond.


Oh, sorry for that.

Is it possible to call nvdimm_build_device_structure() in
nvdimm_init_fit_buffer() so we don't need to duplicate the details of
how the GArray is created?


Actually, i tried your suggestion however i noticed it makes the code
little confuse, as we construct the fit by calling
nvdimm_build_device_structure() whose name shows the fit will be
rebuild but do not set .dirty in the init path.

g_array_new(false, true /* clear */, 1) is a more clear way to
show this is just a empty array.






--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux