qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Xinhao Zhang <zhangxinhao1@huawei.com>
Cc: xiaoguangrong.eric@gmail.com, mst@redhat.com,
	qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	alex.chen@huawei.com, dengkai1@huawei.com
Subject: Re: [PATCH 1/3] hw/acpi : Don't use '#' flag of printf format
Date: Tue, 3 Nov 2020 13:27:56 +0100	[thread overview]
Message-ID: <20201103132756.5e9e1bbd@redhat.com> (raw)
In-Reply-To: <20201103102634.273021-1-zhangxinhao1@huawei.com>

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;



      parent reply	other threads:[~2020-11-03 12:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Igor Mammedov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201103132756.5e9e1bbd@redhat.com \
    --to=imammedo@redhat.com \
    --cc=alex.chen@huawei.com \
    --cc=dengkai1@huawei.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=xiaoguangrong.eric@gmail.com \
    --cc=zhangxinhao1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).