qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM)
@ 2022-01-07 15:49 Stefan Weil
  2022-02-24 21:22 ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2022-01-07 15:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Marc-André Lureau, Stefan Weil

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

LGTM has some more alerts which need attention:
https://lgtm.com/projects/g/qemu/qemu/

Regards,
Stefan

 subprojects/libvhost-user/libvhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index 787f4d2d4f..6eb72c4200 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -651,7 +651,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",
+                          "@%" PRIx64 " + size:%zx offset: %zx: (ufd=%d)%s\n",
                      __func__, i,
                      dev_region->mmap_addr,
                      dev_region->size, dev_region->mmap_offset,
-- 
2.30.2



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

* Re: [PATCH] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM)
  2022-01-07 15:49 [PATCH] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM) Stefan Weil
@ 2022-02-24 21:22 ` Stefan Weil
  2022-02-24 22:26   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2022-02-24 21:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Marc-André Lureau

Am 07.01.22 um 16:49 schrieb Stefan Weil:

> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>
> LGTM has some more alerts which need attention:
> https://lgtm.com/projects/g/qemu/qemu/
>
> Regards,
> Stefan
>
>   subprojects/libvhost-user/libvhost-user.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
> index 787f4d2d4f..6eb72c4200 100644
> --- a/subprojects/libvhost-user/libvhost-user.c
> +++ b/subprojects/libvhost-user/libvhost-user.c
> @@ -651,7 +651,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",
> +                          "@%" PRIx64 " + size:%zx offset: %zx: (ufd=%d)%s\n",
>                        __func__, i,
>                        dev_region->mmap_addr,
>                        dev_region->size, dev_region->mmap_offset,


Up to now I did not see any response to this patch, and it is also still 
missing in the latest code.

dev_region->mmap_addr is an uint64_t value, so the current format string 
"%p" won't work on any platform where pointers are not 64 bit value.

Stefan




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

* Re: [PATCH] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM)
  2022-02-24 21:22 ` Stefan Weil
@ 2022-02-24 22:26   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-02-24 22:26 UTC (permalink / raw)
  To: Stefan Weil, qemu-devel; +Cc: qemu-trivial, Marc-André Lureau

On 24/2/22 22:22, Stefan Weil wrote:
> Am 07.01.22 um 16:49 schrieb Stefan Weil:
> 
>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>> ---
>>
>> LGTM has some more alerts which need attention:
>> https://lgtm.com/projects/g/qemu/qemu/
>>
>> Regards,
>> Stefan
>>
>>   subprojects/libvhost-user/libvhost-user.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/subprojects/libvhost-user/libvhost-user.c 
>> b/subprojects/libvhost-user/libvhost-user.c
>> index 787f4d2d4f..6eb72c4200 100644
>> --- a/subprojects/libvhost-user/libvhost-user.c
>> +++ b/subprojects/libvhost-user/libvhost-user.c
>> @@ -651,7 +651,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",
>> +                          "@%" PRIx64 " + size:%zx offset: %zx: 
>> (ufd=%d)%s\n",
>>                        __func__, i,
>>                        dev_region->mmap_addr,
>>                        dev_region->size, dev_region->mmap_offset,
> 
> 
> Up to now I did not see any response to this patch, and it is also still 
> missing in the latest code.
> 
> dev_region->mmap_addr is an uint64_t value, so the current format string 
> "%p" won't work on any platform where pointers are not 64 bit value.
> 
> Stefan
> 
> 
> 

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



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

end of thread, other threads:[~2022-02-24 22:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-07 15:49 [PATCH] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM) Stefan Weil
2022-02-24 21:22 ` Stefan Weil
2022-02-24 22:26   ` Philippe Mathieu-Daudé

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).