]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
nvdimm: use *function* directly instead of allocating it again
authorWei Yang <richardw.yang@linux.intel.com>
Wed, 27 Feb 2019 07:50:59 +0000 (15:50 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 13 Mar 2019 02:31:21 +0000 (22:31 -0400)
At the beginning or nvdimm_build_common_dsm(), variable *function* is
already allocated for Arg2.

This patch reuse variable *function* instead of allocating it again.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190227075101.6263-3-richardw.yang@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
hw/acpi/nvdimm.c

index 280bfb9d7851015079a8fda1f9963bbf792c0f3a..3e73ed456f14a44b26432592dff156fae747a980 100644 (file)
@@ -1086,7 +1086,7 @@ static void nvdimm_build_common_dsm(Aml *dev)
      */
     aml_append(method, aml_store(handle, aml_name(NVDIMM_DSM_HANDLE)));
     aml_append(method, aml_store(aml_arg(1), aml_name(NVDIMM_DSM_REVISION)));
-    aml_append(method, aml_store(aml_arg(2), aml_name(NVDIMM_DSM_FUNCTION)));
+    aml_append(method, aml_store(function, aml_name(NVDIMM_DSM_FUNCTION)));
 
     /*
      * The fourth parameter (Arg3) of _DSM is a package which contains