his is the first attempt at some
>> obvious fixes that can be done without any harm to the code and its
>> readability.
>> Marcel Holtmann (12):
>> libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
>> libvhost-user: Replace typeof with __typeof__
>>
’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
223 | for (i = 0; i < dev->nregions; i++) {
| ^
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff
by the build system.
Signed-off-by: Marcel Holtmann
---
subprojects/libvduse/libvduse.c | 4
1 file changed, 4 insertions(+)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index e089d4d546cf..c871bd331a6b 100644
--- a/subprojects/libvduse/libvduse.c
+++ b/subprojects
[-Werror=declaration-after-statement]
683 | struct uffdio_register reg_struct;
| ^~
In this case, it is also simple enough and doesn't cause any extra
ifdef additions.
Signed-off-by: Marcel Holtmann
Reviewed-by: Philippe Mathieu-Daudé
---
subprojects/libvhost-user
that can be done without any harm to the code and its
readability.
Marcel Holtmann (12):
libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
libvhost-user: Replace typeof with __typeof__
libvhost-user: Cast rc variable to avoid compiler warning
libvhost-user: Use unsigned int i
ler warning switched on.
Signed-off-by: Marcel Holtmann
---
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 67d75ece53b7..bcdf32a24f60 100
’
[-Werror=implicit-function-declaration]
86 | typeof(x) _min1 = (x); \
| ^~
Changing these two users of typeof makes the compiler happy and no extra
flags or pragmas need to be provided.
Signed-off-by: Marcel Holtmann
Reviewed-by: Philippe Mathieu-Daudé
*)>vring.used->ring[vq->vring.num]) = htole16(val);
| ~^
Signed-off-by: Marcel Holtmann
Suggested-by: Xie Yongji
Suggested-by: Paolo Bonzini
---
subprojects/libvduse/libvduse.c | 3 ++-
1 file changed, 2 insertions(+), 1
=sign-compare]
789 | if (vq->inuse >= vq->vring.num) {
| ^~
Instead of casting the comparison to unsigned int, just make the inuse
field unsigned int in the fist place.
Signed-off-by: Marcel Holtmann
Reviewed-by: Xie Yongji
---
subprojects/libvduse/libvduse.c
In case libvhost-user is used externally, that projects compiler
warnings might be more strict. Enforce an extra set of compiler warnings
to catch issues early on.
Signed-off-by: Marcel Holtmann
Suggested-by: Paolo Bonzini
---
subprojects/libvduse/meson.build | 8 +++-
1 file changed, 7
Hi Paolo,
>> static inline void vring_set_avail_event(VduseVirtq *vq, uint16_t val)
>> {
>> -*((uint16_t *)>vring.used->ring[vq->vring.num]) = htole16(val);
>> +uint16_t *avail;
>> +
>> +avail = (uint16_t *)>vring.used->ring[vq->vring.num];
>> +*avail = htole16(val);
>
> That
In case libvhost-user is used externally, that projects compiler
warnings might be more strict. Enforce an extra set of compiler warnings
to catch issues early on.
Signed-off-by: Marcel Holtmann
Suggested-by: Paolo Bonzini
---
subprojects/libvhost-user/meson.build | 8 +++-
1 file changed
Since it was proposed to change the code in libvduse.c to use memcpy
instead of an assignment, the code in libvhost-user.c should also be
changed to use memcpy.
Signed-off-by: Marcel Holtmann
Suggested-by: Paolo Bonzini
---
subprojects/libvhost-user/libvhost-user.c | 5 ++---
1 file changed, 2
3: error: implicit declaration of function ‘typeof’
>> [-Werror=implicit-function-declaration]
>>86 | typeof(x) _min1 = (x); \
>> | ^~
>> Changing these two users of typeof makes the compiler happy and no extra
>> fl
RCE if it is not already set by the build system.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 4
1 file changed, 4 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index d6ee6e7d9168..b55b9e244d9a 100
ter-statement]
1625 | struct uffdio_api api_struct;
| ^~
Understandable, it might be desired to avoid else clauses, but in this
case it seems clear enough and frankly the dev->postcopy_ufd is only
assigned once.
Signed-off-by: Marcel Holtmann
Reviewed-by: Philippe Mathieu
by the build system.
Signed-off-by: Marcel Holtmann
---
subprojects/libvduse/libvduse.c | 4
1 file changed, 4 insertions(+)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index e089d4d546cf..c871bd331a6b 100644
--- a/subprojects/libvduse/libvduse.c
+++ b/subprojects
re]
2808 | if (num > vq->inuse) {
| ^
Instead of casting the comparison to unsigned int, just make the inuse
field unsigned int in the fist place.
Signed-off-by: Marcel Holtmann
Reviewed-by: Philippe Mathieu-Daudé
---
subprojects/libvhost-user/libvhost-user.h | 2 +-
1
-aliasin]
603 | *((uint16_t *)>vring.used->ring[vq->vring.num]) = htole16(val);
| ~^
Signed-off-by: Marcel Holtmann
Suggested-by: Xie Yongji
---
subprojects/libvduse/libvduse.c | 5 -
1 file changed, 4 insertions(+), 1
’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
223 | for (i = 0; i < dev->nregions; i++) {
| ^
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff
RCE if it is not already set by the build system.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 4
1 file changed, 4 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index d6ee6e7d9168..b55b9e244d9a 100
that can be done without any harm to the code and its
readability.
Marcel Holtmann (10):
libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
libvhost-user: Replace typeof with __typeof__
libvhost-user: Cast rc variable to avoid compiler warning
libvhost-user: Use unsigned int i
’
[-Werror=implicit-function-declaration]
86 | typeof(x) _min1 = (x); \
| ^~
Changing these two users of typeof makes the compiler happy and no extra
flags or pragmas need to be provided.
Signed-off-by: Marcel Holtmann
Reviewed-by: Philippe Mathieu-Daudé
[-Werror=declaration-after-statement]
683 | struct uffdio_register reg_struct;
| ^~
In this case, it is also simple enough and doesn't cause any extra
ifdef additions.
Signed-off-by: Marcel Holtmann
Reviewed-by: Philippe Mathieu-Daudé
---
subprojects/libvhost-user
ter-statement]
1625 | struct uffdio_api api_struct;
| ^~
Understandable, it might be desired to avoid else clauses, but in this
case it seems clear enough and frankly the dev->postcopy_ufd is only
assigned once.
Signed-off-by: Marcel Holtmann
Reviewed-by: Philippe Mathieu
ng[vq->vring.num]) =
>> htole16(val);
>> | ~^~~~~
>>
>> Signed-off-by: Marcel Holtmann
>> ---
>> subprojects/libvduse/libvduse.c | 5 -
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
ler warning switched on.
Signed-off-by: Marcel Holtmann
---
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 67d75ece53b7..bcdf32a24f60 100
=sign-compare]
789 | if (vq->inuse >= vq->vring.num) {
| ^~
Instead of casting the comparison to unsigned int, just make the inuse
field unsigned int in the fist place.
Signed-off-by: Marcel Holtmann
Reviewed-by: Xie Yongji
---
subprojects/libvduse/libvduse.c
ter-statement]
1625 | struct uffdio_api api_struct;
| ^~
Understandable, it might be desired to avoid else clauses, but in this
case it seems clear enough and frankly the dev->postcopy_ufd is only
assigned once.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/li
[-Werror=declaration-after-statement]
683 | struct uffdio_register reg_struct;
| ^~
In this case, it is also simple enough and doesn't cause any extra
ifdef additions.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 4 +++-
1 file changed
ler warning switched on.
Signed-off-by: Marcel Holtmann
---
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 67d75ece53b7..bcdf32a24f60 100
or it better be commented accordingly
to tell the compiler that it got this part wrong.
Marcel Holtmann (10):
libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
libvhost-user: Replace typeof with __typeof__
libvhost-user: Cast rc variable to avoid compiler warning
libvhost
by the build system.
Signed-off-by: Marcel Holtmann
---
subprojects/libvduse/libvduse.c | 4
1 file changed, 4 insertions(+)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index e089d4d546cf..c871bd331a6b 100644
--- a/subprojects/libvduse/libvduse.c
+++ b/subprojects
=sign-compare]
789 | if (vq->inuse >= vq->vring.num) {
| ^~
Instead of casting the comparison to unsigned int, just make the inuse
field unsigned int in the fist place.
Signed-off-by: Marcel Holtmann
---
subprojects/libvduse/libvduse.c | 2 +-
1 file c
re]
2808 | if (num > vq->inuse) {
| ^
Instead of casting the comparison to unsigned int, just make the inuse
field unsigned int in the fist place.
Signed-off-by: Marcel Holtmann
Reviewed-by: Philippe Mathieu-Daudé
---
subprojects/libvhost-user/libvhost-user.h | 2 +-
1
’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
223 | for (i = 0; i < dev->nregions; i++) {
| ^
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff
RCE if it is not already set by the build system.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 4
1 file changed, 4 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index d6ee6e7d9168..b55b9e244d9a 100
’
[-Werror=implicit-function-declaration]
86 | typeof(x) _min1 = (x); \
| ^~
Changing these two users of typeof makes the compiler happy and no extra
flags or pragmas need to be provided.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user
ole16(val);
| ~^
Signed-off-by: Marcel Holtmann
---
subprojects/libvduse/libvduse.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index 338ad5e352e7..51a4ba1b6878 100644
--- a/su
omparison of integer expressions of
>> different signedness: ‘unsigned int’ and ‘int’ [-Werror=sign-compare]
>> 2808 | if (num > vq->inuse) {
>> | ^
>>
>> Instead of casting the comparision to unsigned int, just make the inuse
>&
son of integer expressions of
>> different signedness: ‘unsigned int’ and ‘int’ [-Werror=sign-compare]
>> 2808 | if (num > vq->inuse) {
>> | ^
>> Instead of casting the comparision to unsigned int, just make the inuse
>> field unsigned int i
the structures point of view the assignment
that is done makes no sense to me. I might have to dig into
specification to figure it out or it better be commented accordingly to
tell the compiler that it got this part wrong.
Marcel Holtmann (3):
libvduse: Provide _GNU_SOURCE when compiling outside
ole16(val);
| ~^
Signed-off-by: Marcel Holtmann
---
subprojects/libvduse/libvduse.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index 338ad5e352e7..51a4ba1b6878 100644
--- a/su
=sign-compare]
789 | if (vq->inuse >= vq->vring.num) {
| ^~
Instead of casting the comparison to unsigned int, just make the inuse
field unsigned int in the fist place.
Signed-off-by: Marcel Holtmann
---
subprojects/libvduse/libvduse.c | 2 +-
1 file c
by the build system.
Signed-off-by: Marcel Holtmann
---
subprojects/libvduse/libvduse.c | 4
1 file changed, 4 insertions(+)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index e089d4d546cf..c871bd331a6b 100644
--- a/subprojects/libvduse/libvduse.c
+++ b/subprojects
[-Werror=declaration-after-statement]
683 | struct uffdio_register reg_struct;
| ^~
In this case, it is also simple enough and doesn't cause any extra
ifdef additions.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 4 +++-
1 file changed
ler warning switched on.
Signed-off-by: Marcel Holtmann
---
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 67d75ece53b7..bcdf32a24f60 100
that can be done without any harm to the code and its
readabilty.
Marcel Holtmann (7):
libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
libvhost-user: Replace typeof with __typeof__
libvhost-user: Cast rc variable to avoid compiler warning
libvhost-user: Use unsigned int i
RCE if it is not already set by the build system.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 4
1 file changed, 4 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index d6ee6e7d9168..b55b9e244d9a 100
’
[-Werror=implicit-function-declaration]
86 | typeof(x) _min1 = (x); \
| ^~
Changing these two users of typeof makes the compiler happy and no extra
flags or pragmas need to be provided.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user
re]
2808 | if (num > vq->inuse) {
| ^
Instead of casting the comparision to unsigned int, just make the inuse
field unsigned int in the fist place.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion
’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
223 | for (i = 0; i < dev->nregions; i++) {
| ^
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/libvhost-user.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff
ter-statement]
1625 | struct uffdio_api api_struct;
| ^~
Understandable, it might be desired to avoid else clauses, but in this
case it seems clear enough and frankly the dev->postcopy_ufd is only
assigned once.
Signed-off-by: Marcel Holtmann
---
subprojects/libvhost-user/li
53 matches
Mail list logo