qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format
@ 2020-11-03 10:26 Xinhao Zhang
  2020-11-03 10:26 ` [PATCH 2/3] hw/acpi : add space before the open parenthesis '(' Xinhao Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Xinhao Zhang @ 2020-11-03 10:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: xiaoguangrong.eric, mst, qemu-trivial, alex.chen, imammedo,
	dengkai1

Fix code style. Don't use '#' flag of printf format ('%#') in
format strings, use '0x' prefix instead

Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
Signed-off-by: Kai Deng <dengkai1@huawei.com>
---
 hw/acpi/nvdimm.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index 8f7cc16add..8ad5516142 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -556,7 +556,7 @@ static void nvdimm_dsm_func_read_fit(NVDIMMState *state, NvdimmDsmIn *in,
 
     fit = fit_buf->fit;
 
-    nvdimm_debug("Read FIT: offset %#x FIT size %#x Dirty %s.\n",
+    nvdimm_debug("Read FIT: offset 0x%x FIT size 0x%x Dirty %s.\n",
                  read_fit->offset, fit->len, fit_buf->dirty ? "Yes" : "No");
 
     if (read_fit->offset > fit->len) {
@@ -664,7 +664,7 @@ static void nvdimm_dsm_label_size(NVDIMMDevice *nvdimm, hwaddr dsm_mem_addr)
     label_size = nvdimm->label_size;
     mxfer = nvdimm_get_max_xfer_label_size();
 
-    nvdimm_debug("label_size %#x, max_xfer %#x.\n", label_size, mxfer);
+    nvdimm_debug("label_size 0x%x, max_xfer 0x%x.\n", label_size, mxfer);
 
     label_size_out.func_ret_status = cpu_to_le32(NVDIMM_DSM_RET_STATUS_SUCCESS);
     label_size_out.label_size = cpu_to_le32(label_size);
@@ -680,19 +680,19 @@ static uint32_t nvdimm_rw_label_data_check(NVDIMMDevice *nvdimm,
     uint32_t ret = NVDIMM_DSM_RET_STATUS_INVALID;
 
     if (offset + length < offset) {
-        nvdimm_debug("offset %#x + length %#x is overflow.\n", offset,
+        nvdimm_debug("offset 0x%x + length 0x%x is overflow.\n", offset,
                      length);
         return ret;
     }
 
     if (nvdimm->label_size < offset + length) {
-        nvdimm_debug("position %#x is beyond label data (len = %" PRIx64 ").\n",
+        nvdimm_debug("position 0x%x is beyond label data (len = %" PRIx64 ").\n",
                      offset + length, nvdimm->label_size);
         return ret;
     }
 
     if (length > nvdimm_get_max_xfer_label_size()) {
-        nvdimm_debug("length (%#x) is larger than max_xfer (%#x).\n",
+        nvdimm_debug("length (0x%x) is larger than max_xfer (0x%x).\n",
                      length, nvdimm_get_max_xfer_label_size());
         return ret;
     }
@@ -716,7 +716,7 @@ static void nvdimm_dsm_get_label_data(NVDIMMDevice *nvdimm, NvdimmDsmIn *in,
     get_label_data->offset = le32_to_cpu(get_label_data->offset);
     get_label_data->length = le32_to_cpu(get_label_data->length);
 
-    nvdimm_debug("Read Label Data: offset %#x length %#x.\n",
+    nvdimm_debug("Read Label Data: offset 0x%x length 0x%x.\n",
                  get_label_data->offset, get_label_data->length);
 
     status = nvdimm_rw_label_data_check(nvdimm, get_label_data->offset,
@@ -755,7 +755,7 @@ static void nvdimm_dsm_set_label_data(NVDIMMDevice *nvdimm, NvdimmDsmIn *in,
     set_label_data->offset = le32_to_cpu(set_label_data->offset);
     set_label_data->length = le32_to_cpu(set_label_data->length);
 
-    nvdimm_debug("Write Label Data: offset %#x length %#x.\n",
+    nvdimm_debug("Write Label Data: offset 0x%x length 0x%x.\n",
                  set_label_data->offset, set_label_data->length);
 
     status = nvdimm_rw_label_data_check(nvdimm, set_label_data->offset,
@@ -838,7 +838,7 @@ nvdimm_dsm_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
     NvdimmDsmIn *in;
     hwaddr dsm_mem_addr = val;
 
-    nvdimm_debug("dsm memory address %#" HWADDR_PRIx ".\n", dsm_mem_addr);
+    nvdimm_debug("dsm memory address 0x%" HWADDR_PRIx ".\n", dsm_mem_addr);
 
     /*
      * The DSM memory is mapped to guest address space so an evil guest
@@ -852,11 +852,11 @@ nvdimm_dsm_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
     in->function = le32_to_cpu(in->function);
     in->handle = le32_to_cpu(in->handle);
 
-    nvdimm_debug("Revision %#x Handler %#x Function %#x.\n", in->revision,
+    nvdimm_debug("Revision 0x%x Handler 0x%x Function 0x%x.\n", in->revision,
                  in->handle, in->function);
 
     if (in->revision != 0x1 /* Currently we only support DSM Spec Rev1. */) {
-        nvdimm_debug("Revision %#x is not supported, expect %#x.\n",
+        nvdimm_debug("Revision 0x%x is not supported, expect 0x%x.\n",
                      in->revision, 0x1);
         nvdimm_dsm_no_payload(NVDIMM_DSM_RET_STATUS_UNSUPPORT, dsm_mem_addr);
         goto exit;
-- 
2.29.0-rc1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] hw/acpi : add space before the open parenthesis '('
  2020-11-03 10:26 [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format Xinhao Zhang
@ 2020-11-03 10:26 ` Xinhao Zhang
  2020-11-03 12:28   ` Igor Mammedov
  2020-11-03 10:26 ` [PATCH 3/3] hw/acpi : add spaces around operator Xinhao Zhang
  2020-11-03 12:27 ` [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format Igor Mammedov
  2 siblings, 1 reply; 6+ messages in thread
From: Xinhao Zhang @ 2020-11-03 10:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: xiaoguangrong.eric, mst, qemu-trivial, alex.chen, imammedo,
	dengkai1

Fix code style. Space required before the open parenthesis '('.

Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
Signed-off-by: Kai Deng <dengkai1@huawei.com>
---
 hw/acpi/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index ade9158cbf..2c0c83221f 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -558,7 +558,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
     if (val & ACPI_BITMASK_SLEEP_ENABLE) {
         /* change suspend type */
         uint16_t sus_typ = (val >> 10) & 7;
-        switch(sus_typ) {
+        switch (sus_typ) {
         case 0: /* soft power off */
             qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
             break;
-- 
2.29.0-rc1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] hw/acpi : add spaces around operator
  2020-11-03 10:26 [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format Xinhao Zhang
  2020-11-03 10:26 ` [PATCH 2/3] hw/acpi : add space before the open parenthesis '(' Xinhao Zhang
@ 2020-11-03 10:26 ` Xinhao Zhang
  2020-11-03 12:28   ` Igor Mammedov
  2020-11-03 12:27 ` [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format Igor Mammedov
  2 siblings, 1 reply; 6+ messages in thread
From: Xinhao Zhang @ 2020-11-03 10:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: xiaoguangrong.eric, mst, qemu-trivial, alex.chen, imammedo,
	dengkai1

Fix code style. Operator needs spaces both sides.

Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
Signed-off-by: Kai Deng <dengkai1@huawei.com>
---
 hw/acpi/pcihp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 32ae8b2c0a..17c32e0ffd 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -400,7 +400,7 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,
     s->io_len = ACPI_PCIHP_SIZE;
     s->io_base = ACPI_PCIHP_ADDR;
 
-    s->root= root_bus;
+    s->root = root_bus;
     s->legacy_piix = !bridges_enabled;
 
     memory_region_init_io(&s->io, owner, &acpi_pcihp_io_ops, s,
-- 
2.29.0-rc1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format
  2020-11-03 10:26 [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format Xinhao Zhang
  2020-11-03 10:26 ` [PATCH 2/3] hw/acpi : add space before the open parenthesis '(' Xinhao Zhang
  2020-11-03 10:26 ` [PATCH 3/3] hw/acpi : add spaces around operator Xinhao Zhang
@ 2020-11-03 12:27 ` Igor Mammedov
  2 siblings, 0 replies; 6+ messages in thread
From: Igor Mammedov @ 2020-11-03 12:27 UTC (permalink / raw)
  To: Xinhao Zhang
  Cc: xiaoguangrong.eric, mst, qemu-trivial, qemu-devel, alex.chen,
	dengkai1

On Tue, 3 Nov 2020 18:26:32 +0800
Xinhao Zhang <zhangxinhao1@huawei.com> wrote:

> Fix code style. Don't use '#' flag of printf format ('%#') in
> format strings, use '0x' prefix instead
> 
> Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
> Signed-off-by: Kai Deng <dengkai1@huawei.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

---
PS: in future please use --cover-letter when sending series of multiple patches.

> ---
>  hw/acpi/nvdimm.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> index 8f7cc16add..8ad5516142 100644
> --- a/hw/acpi/nvdimm.c
> +++ b/hw/acpi/nvdimm.c
> @@ -556,7 +556,7 @@ static void nvdimm_dsm_func_read_fit(NVDIMMState *state, NvdimmDsmIn *in,
>  
>      fit = fit_buf->fit;
>  
> -    nvdimm_debug("Read FIT: offset %#x FIT size %#x Dirty %s.\n",
> +    nvdimm_debug("Read FIT: offset 0x%x FIT size 0x%x Dirty %s.\n",
>                   read_fit->offset, fit->len, fit_buf->dirty ? "Yes" : "No");
>  
>      if (read_fit->offset > fit->len) {
> @@ -664,7 +664,7 @@ static void nvdimm_dsm_label_size(NVDIMMDevice *nvdimm, hwaddr dsm_mem_addr)
>      label_size = nvdimm->label_size;
>      mxfer = nvdimm_get_max_xfer_label_size();
>  
> -    nvdimm_debug("label_size %#x, max_xfer %#x.\n", label_size, mxfer);
> +    nvdimm_debug("label_size 0x%x, max_xfer 0x%x.\n", label_size, mxfer);
>  
>      label_size_out.func_ret_status = cpu_to_le32(NVDIMM_DSM_RET_STATUS_SUCCESS);
>      label_size_out.label_size = cpu_to_le32(label_size);
> @@ -680,19 +680,19 @@ static uint32_t nvdimm_rw_label_data_check(NVDIMMDevice *nvdimm,
>      uint32_t ret = NVDIMM_DSM_RET_STATUS_INVALID;
>  
>      if (offset + length < offset) {
> -        nvdimm_debug("offset %#x + length %#x is overflow.\n", offset,
> +        nvdimm_debug("offset 0x%x + length 0x%x is overflow.\n", offset,
>                       length);
>          return ret;
>      }
>  
>      if (nvdimm->label_size < offset + length) {
> -        nvdimm_debug("position %#x is beyond label data (len = %" PRIx64 ").\n",
> +        nvdimm_debug("position 0x%x is beyond label data (len = %" PRIx64 ").\n",
>                       offset + length, nvdimm->label_size);
>          return ret;
>      }
>  
>      if (length > nvdimm_get_max_xfer_label_size()) {
> -        nvdimm_debug("length (%#x) is larger than max_xfer (%#x).\n",
> +        nvdimm_debug("length (0x%x) is larger than max_xfer (0x%x).\n",
>                       length, nvdimm_get_max_xfer_label_size());
>          return ret;
>      }
> @@ -716,7 +716,7 @@ static void nvdimm_dsm_get_label_data(NVDIMMDevice *nvdimm, NvdimmDsmIn *in,
>      get_label_data->offset = le32_to_cpu(get_label_data->offset);
>      get_label_data->length = le32_to_cpu(get_label_data->length);
>  
> -    nvdimm_debug("Read Label Data: offset %#x length %#x.\n",
> +    nvdimm_debug("Read Label Data: offset 0x%x length 0x%x.\n",
>                   get_label_data->offset, get_label_data->length);
>  
>      status = nvdimm_rw_label_data_check(nvdimm, get_label_data->offset,
> @@ -755,7 +755,7 @@ static void nvdimm_dsm_set_label_data(NVDIMMDevice *nvdimm, NvdimmDsmIn *in,
>      set_label_data->offset = le32_to_cpu(set_label_data->offset);
>      set_label_data->length = le32_to_cpu(set_label_data->length);
>  
> -    nvdimm_debug("Write Label Data: offset %#x length %#x.\n",
> +    nvdimm_debug("Write Label Data: offset 0x%x length 0x%x.\n",
>                   set_label_data->offset, set_label_data->length);
>  
>      status = nvdimm_rw_label_data_check(nvdimm, set_label_data->offset,
> @@ -838,7 +838,7 @@ nvdimm_dsm_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
>      NvdimmDsmIn *in;
>      hwaddr dsm_mem_addr = val;
>  
> -    nvdimm_debug("dsm memory address %#" HWADDR_PRIx ".\n", dsm_mem_addr);
> +    nvdimm_debug("dsm memory address 0x%" HWADDR_PRIx ".\n", dsm_mem_addr);
>  
>      /*
>       * The DSM memory is mapped to guest address space so an evil guest
> @@ -852,11 +852,11 @@ nvdimm_dsm_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
>      in->function = le32_to_cpu(in->function);
>      in->handle = le32_to_cpu(in->handle);
>  
> -    nvdimm_debug("Revision %#x Handler %#x Function %#x.\n", in->revision,
> +    nvdimm_debug("Revision 0x%x Handler 0x%x Function 0x%x.\n", in->revision,
>                   in->handle, in->function);
>  
>      if (in->revision != 0x1 /* Currently we only support DSM Spec Rev1. */) {
> -        nvdimm_debug("Revision %#x is not supported, expect %#x.\n",
> +        nvdimm_debug("Revision 0x%x is not supported, expect 0x%x.\n",
>                       in->revision, 0x1);
>          nvdimm_dsm_no_payload(NVDIMM_DSM_RET_STATUS_UNSUPPORT, dsm_mem_addr);
>          goto exit;



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] hw/acpi : add space before the open parenthesis '('
  2020-11-03 10:26 ` [PATCH 2/3] hw/acpi : add space before the open parenthesis '(' Xinhao Zhang
@ 2020-11-03 12:28   ` Igor Mammedov
  0 siblings, 0 replies; 6+ messages in thread
From: Igor Mammedov @ 2020-11-03 12:28 UTC (permalink / raw)
  To: Xinhao Zhang
  Cc: xiaoguangrong.eric, mst, qemu-trivial, qemu-devel, alex.chen,
	dengkai1

On Tue, 3 Nov 2020 18:26:33 +0800
Xinhao Zhang <zhangxinhao1@huawei.com> wrote:

> Fix code style. Space required before the open parenthesis '('.
> 
> Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
> Signed-off-by: Kai Deng <dengkai1@huawei.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/acpi/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index ade9158cbf..2c0c83221f 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -558,7 +558,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
>      if (val & ACPI_BITMASK_SLEEP_ENABLE) {
>          /* change suspend type */
>          uint16_t sus_typ = (val >> 10) & 7;
> -        switch(sus_typ) {
> +        switch (sus_typ) {
>          case 0: /* soft power off */
>              qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
>              break;



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] hw/acpi : add spaces around operator
  2020-11-03 10:26 ` [PATCH 3/3] hw/acpi : add spaces around operator Xinhao Zhang
@ 2020-11-03 12:28   ` Igor Mammedov
  0 siblings, 0 replies; 6+ messages in thread
From: Igor Mammedov @ 2020-11-03 12:28 UTC (permalink / raw)
  To: Xinhao Zhang
  Cc: xiaoguangrong.eric, mst, qemu-trivial, qemu-devel, alex.chen,
	dengkai1

On Tue, 3 Nov 2020 18:26:34 +0800
Xinhao Zhang <zhangxinhao1@huawei.com> wrote:

> Fix code style. Operator needs spaces both sides.
> 
> Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
> Signed-off-by: Kai Deng <dengkai1@huawei.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/acpi/pcihp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
> index 32ae8b2c0a..17c32e0ffd 100644
> --- a/hw/acpi/pcihp.c
> +++ b/hw/acpi/pcihp.c
> @@ -400,7 +400,7 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,
>      s->io_len = ACPI_PCIHP_SIZE;
>      s->io_base = ACPI_PCIHP_ADDR;
>  
> -    s->root= root_bus;
> +    s->root = root_bus;
>      s->legacy_piix = !bridges_enabled;
>  
>      memory_region_init_io(&s->io, owner, &acpi_pcihp_io_ops, s,



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-03 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-03 10:26 [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format Xinhao Zhang
2020-11-03 10:26 ` [PATCH 2/3] hw/acpi : add space before the open parenthesis '(' Xinhao Zhang
2020-11-03 12:28   ` Igor Mammedov
2020-11-03 10:26 ` [PATCH 3/3] hw/acpi : add spaces around operator Xinhao Zhang
2020-11-03 12:28   ` Igor Mammedov
2020-11-03 12:27 ` [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).