[PATCH] hw/hyperv/vmbus.c : Don't use '#' flag of printf format

jokenzhang posted 1 patch 3 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201029134933.1138718-1-zhangxinhao1@huawei.com
hw/hyperv/vmbus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] hw/hyperv/vmbus.c : Don't use '#' flag of printf format
Posted by jokenzhang 3 years, 6 months ago
Fix code style. Don't use '#' flag of printf format ('%#') in
format strings, use '0x' prefix instead

Signed-off-by: jokenzhang <zhangxinhao1@huawei.com>
Signed-off-by: Kai Deng <dengkai1@huawei.com>
Reported-by: Euler Robot <euler.robot@huawei.com>
---
 hw/hyperv/vmbus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index 896e981f85..bd64a0754c 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -1656,7 +1656,7 @@ static uint16_t vmbus_recv_message(const struct hyperv_post_message_input *msg,
 
     if (vmbus_msg->message_type == VMBUS_MSG_INVALID ||
         vmbus_msg->message_type >= VMBUS_MSG_COUNT) {
-        error_report("vmbus: unknown message type %#x",
+        error_report("vmbus: unknown message type 0x%x",
                      vmbus_msg->message_type);
         return HV_STATUS_INVALID_HYPERCALL_INPUT;
     }
@@ -2230,7 +2230,7 @@ static void process_message(VMBus *vmbus)
         handle_unload(vmbus, msgdata, msglen);
         break;
     default:
-        error_report("unknown message type %#x", msg->message_type);
+        error_report("unknown message type 0x%x", msg->message_type);
         break;
     }
 
-- 
2.29.0-rc1


Re: [PATCH] hw/hyperv/vmbus.c : Don't use '#' flag of printf format
Posted by Philippe Mathieu-Daudé 3 years, 6 months ago
On 10/29/20 2:49 PM, jokenzhang wrote:
> Fix code style. Don't use '#' flag of printf format ('%#') in
> format strings, use '0x' prefix instead
> 
> Signed-off-by: jokenzhang <zhangxinhao1@huawei.com>
> Signed-off-by: Kai Deng <dengkai1@huawei.com>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> ---
>  hw/hyperv/vmbus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>