diff mbox

[08/14] nvdimm acpi: cleanup nvdimm_build_fit

Message ID 1478517229-140028-9-git-send-email-guangrong.xiao@linux.intel.com
State New, archived
Headers show

Commit Message

Xiao Guangrong Nov. 7, 2016, 11:13 a.m. UTC
inline buf_size to refine the code a bit

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
---
 hw/acpi/nvdimm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Stefan Hajnoczi Nov. 7, 2016, 3:33 p.m. UTC | #1
On Mon, Nov 07, 2016 at 07:13:43PM +0800, Xiao Guangrong wrote:
> inline buf_size to refine the code a bit
> 
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> ---
>  hw/acpi/nvdimm.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Igor Mammedov Nov. 9, 2016, 4:40 p.m. UTC | #2
On Mon,  7 Nov 2016 19:13:43 +0800
Xiao Guangrong <guangrong.xiao@linux.intel.com> wrote:

> inline buf_size to refine the code a bit
> 
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> ---
>  hw/acpi/nvdimm.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> 
> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> index f2c0659..148999e 100644
> --- a/hw/acpi/nvdimm.c
> +++ b/hw/acpi/nvdimm.c
> @@ -1134,11 +1134,9 @@ static void nvdimm_build_fit(Aml *dev)
>      aml_append(ifctx, aml_return(aml_buffer(0, NULL)));
>      aml_append(method, ifctx);
>  
> -    aml_append(method, aml_store(aml_shiftleft(buf_size, aml_int(3)),
> -                                 buf_size));
>      aml_append(method, aml_create_field(buf,
>                              aml_int(4 * BITS_PER_BYTE), /* offset at byte 4.*/
> -                            buf_size, "BUFF"));
> +                            aml_shiftleft(buf_size, aml_int(3)), "BUFF"));
>      aml_append(method, aml_return(aml_name("BUFF")));
>      aml_append(dev, method);
>  

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

Patch

diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index f2c0659..148999e 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -1134,11 +1134,9 @@  static void nvdimm_build_fit(Aml *dev)
     aml_append(ifctx, aml_return(aml_buffer(0, NULL)));
     aml_append(method, ifctx);
 
-    aml_append(method, aml_store(aml_shiftleft(buf_size, aml_int(3)),
-                                 buf_size));
     aml_append(method, aml_create_field(buf,
                             aml_int(4 * BITS_PER_BYTE), /* offset at byte 4.*/
-                            buf_size, "BUFF"));
+                            aml_shiftleft(buf_size, aml_int(3)), "BUFF"));
     aml_append(method, aml_return(aml_name("BUFF")));
     aml_append(dev, method);