diff mbox series

libvhost-user: Add GCC_FMT_ATTR and fix format string

Message ID 20200827210920.111611-1-sw@weilnetz.de
State New
Headers show
Series libvhost-user: Add GCC_FMT_ATTR and fix format string | expand

Commit Message

Stefan Weil Aug. 27, 2020, 9:09 p.m. UTC
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 contrib/libvhost-user/libvhost-user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Marc-André Lureau Aug. 27, 2020, 9:32 p.m. UTC | #1
On Fri, Aug 28, 2020 at 1:10 AM Stefan Weil <sw@weilnetz.de> wrote:

> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

---
>  contrib/libvhost-user/libvhost-user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/libvhost-user/libvhost-user.c
> b/contrib/libvhost-user/libvhost-user.c
> index 53f16bdf08..ff7ac876f4 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -151,7 +151,7 @@ vu_request_to_string(unsigned int req)
>      }
>  }
>
> -static void
> +static void GCC_FMT_ATTR(2, 3)
>  vu_panic(VuDev *dev, const char *msg, ...)
>  {
>      char *buf = NULL;
> @@ -643,7 +643,7 @@ generate_faults(VuDev *dev) {
>
>          if (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER, &reg_struct)) {
>              vu_panic(dev, "%s: Failed to userfault region %d "
> -                          "@%p + size:%zx offset: %zx: (ufd=%d)%s\n",
> +                          "@%016"PRIx64" + size:%zx offset: %zx:
> (ufd=%d)%s\n",
>                       __func__, i,
>                       dev_region->mmap_addr,
>                       dev_region->size, dev_region->mmap_offset,
> --
> 2.28.0
>
>
>
Philippe Mathieu-Daudé Aug. 31, 2020, 7:52 p.m. UTC | #2
Le jeu. 27 août 2020 23:09, Stefan Weil <sw@weilnetz.de> a écrit :

> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  contrib/libvhost-user/libvhost-user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/libvhost-user/libvhost-user.c
> b/contrib/libvhost-user/libvhost-user.c
> index 53f16bdf08..ff7ac876f4 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -151,7 +151,7 @@ vu_request_to_string(unsigned int req)
>      }
>  }
>
> -static void
> +static void GCC_FMT_ATTR(2, 3)
>  vu_panic(VuDev *dev, const char *msg, ...)
>  {
>      char *buf = NULL;
> @@ -643,7 +643,7 @@ generate_faults(VuDev *dev) {
>
>          if (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER, &reg_struct)) {
>              vu_panic(dev, "%s: Failed to userfault region %d "
> -                          "@%p + size:%zx offset: %zx: (ufd=%d)%s\n",
> +                          "@%016"PRIx64" + size:%zx offset: %zx:
> (ufd=%d)%s\n",
>

I thought I had fixed this last month, but I don't have my email backlog,
so:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

                      __func__, i,
>                       dev_region->mmap_addr,
>                       dev_region->size, dev_region->mmap_offset,
> --
> 2.28.0
>
>
>
Raphael Norwitz Aug. 31, 2020, 10:02 p.m. UTC | #3
On Thu, Aug 27, 2020 at 5:09 PM Stefan Weil <sw@weilnetz.de> wrote:
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>

> ---
>  contrib/libvhost-user/libvhost-user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
> index 53f16bdf08..ff7ac876f4 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -151,7 +151,7 @@ vu_request_to_string(unsigned int req)
>      }
>  }
>
> -static void
> +static void GCC_FMT_ATTR(2, 3)
>  vu_panic(VuDev *dev, const char *msg, ...)
>  {
>      char *buf = NULL;
> @@ -643,7 +643,7 @@ generate_faults(VuDev *dev) {
>
>          if (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER, &reg_struct)) {
>              vu_panic(dev, "%s: Failed to userfault region %d "
> -                          "@%p + size:%zx offset: %zx: (ufd=%d)%s\n",
> +                          "@%016"PRIx64" + size:%zx offset: %zx: (ufd=%d)%s\n",
>                       __func__, i,
>                       dev_region->mmap_addr,
>                       dev_region->size, dev_region->mmap_offset,
> --
> 2.28.0
>
>
Philippe Mathieu-Daudé Sept. 1, 2020, 10:14 a.m. UTC | #4
On Mon, Aug 31, 2020 at 9:52 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
>
> Le jeu. 27 août 2020 23:09, Stefan Weil <sw@weilnetz.de> a écrit :
>>
>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>> ---
>>  contrib/libvhost-user/libvhost-user.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
>> index 53f16bdf08..ff7ac876f4 100644
>> --- a/contrib/libvhost-user/libvhost-user.c
>> +++ b/contrib/libvhost-user/libvhost-user.c
>> @@ -151,7 +151,7 @@ vu_request_to_string(unsigned int req)
>>      }
>>  }
>>
>> -static void
>> +static void GCC_FMT_ATTR(2, 3)
>>  vu_panic(VuDev *dev, const char *msg, ...)
>>  {
>>      char *buf = NULL;
>> @@ -643,7 +643,7 @@ generate_faults(VuDev *dev) {
>>
>>          if (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER, &reg_struct)) {
>>              vu_panic(dev, "%s: Failed to userfault region %d "
>> -                          "@%p + size:%zx offset: %zx: (ufd=%d)%s\n",
>> +                          "@%016"PRIx64" + size:%zx offset: %zx: (ufd=%d)%s\n",
>
>
> I thought I had fixed this last month, but I don't have my email backlog,

Ah not it was you =) I remember having looked at it.
https://www.mail-archive.com/qemu-devel@nongnu.org/msg724900.html

> so:
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
>>                       __func__, i,
>>                       dev_region->mmap_addr,
>>                       dev_region->size, dev_region->mmap_offset,
>> --
>> 2.28.0
>>
>>
diff mbox series

Patch

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index 53f16bdf08..ff7ac876f4 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -151,7 +151,7 @@  vu_request_to_string(unsigned int req)
     }
 }
 
-static void
+static void GCC_FMT_ATTR(2, 3)
 vu_panic(VuDev *dev, const char *msg, ...)
 {
     char *buf = NULL;
@@ -643,7 +643,7 @@  generate_faults(VuDev *dev) {
 
         if (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER, &reg_struct)) {
             vu_panic(dev, "%s: Failed to userfault region %d "
-                          "@%p + size:%zx offset: %zx: (ufd=%d)%s\n",
+                          "@%016"PRIx64" + size:%zx offset: %zx: (ufd=%d)%s\n",
                      __func__, i,
                      dev_region->mmap_addr,
                      dev_region->size, dev_region->mmap_offset,