Skip to contentSkip to conversation

migration: Fix warning caused by missing declaration of vmstate_dummy

PATCH In review Stefan Weil 1 participant 3 messages Feb 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: Fix warning caused by missing declaration of vmstate_dummy

Warning from the Sparse static analysis tool:

stubs/vmstate.c:4:26: warning:
symbol 'vmstate_dummy' was not declared. Should it be static?

Cc Juan Quintela <[email protected]>
Cc Amit Shah <[email protected]>
---
 include/migration/vmstate.h | 2 --
 1 file changed, 2 deletions(-)
include/migration/vmstate.h +0 -2
index 0b26bc6..c20f2d1 100644
@@ -139,9 +139,7 @@ struct VMStateDescription {
     const VMStateSubsection *subsections;
 };
 
-#ifdef CONFIG_USER_ONLY
 extern const VMStateDescription vmstate_dummy;
-#endif
 
 extern const VMStateInfo vmstate_info_bool;
 
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 migration: Fix warnings caused by missing 'static' attribute

Warnings from the Sparse static analysis tool:

migration-rdma.c:151:12: warning:
symbol 'wrid_desc' was not declared. Should it be static?
migration-rdma.c:190:12: warning:
symbol 'control_desc' was not declared. Should it be static?
migration-rdma.c:3301:19: warning:
symbol 'rdma_read_ops' was not declared. Should it be static?
migration-rdma.c:3308:19: warning:
symbol 'rdma_write_ops' was not declared. Should it be static?

Cc Juan Quintela <[email protected]>
Cc Amit Shah <[email protected]>
---
 migration/rdma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
migration/rdma.c +4 -4
index fc351ea..589931a 100644
@@ -121,7 +121,7 @@ enum {
     RDMA_WRID_RECV_CONTROL = 4000,
 };
 
-const char *wrid_desc[] = {
+static const char *wrid_desc[] = {
     [RDMA_WRID_NONE] = "NONE",
     [RDMA_WRID_RDMA_WRITE] = "WRITE RDMA",
     [RDMA_WRID_SEND_CONTROL] = "CONTROL SEND",
@@ -160,7 +160,7 @@ enum {
     RDMA_CONTROL_UNREGISTER_FINISHED, /* unpinning finished */
 };
 
-const char *control_desc[] = {
+static const char *control_desc[] = {
     [RDMA_CONTROL_NONE] = "NONE",
     [RDMA_CONTROL_ERROR] = "ERROR",
     [RDMA_CONTROL_READY] = "READY",
@@ -3253,14 +3253,14 @@ static int qemu_rdma_get_fd(void *opaque)
     return rdma->comp_channel->fd;
 }
 
-const QEMUFileOps rdma_read_ops = {
+static const QEMUFileOps rdma_read_ops = {
     .get_buffer    = qemu_rdma_get_buffer,
     .get_fd        = qemu_rdma_get_fd,
     .close         = qemu_rdma_close,
     .hook_ram_load = qemu_rdma_registration_handle,
 };
 
-const QEMUFileOps rdma_write_ops = {
+static const QEMUFileOps rdma_write_ops = {
     .put_buffer         = qemu_rdma_put_buffer,
     .close              = qemu_rdma_close,
     .before_ram_iterate = qemu_rdma_registration_start,
Signature · 1 line
2.1.4
#2 lore raw
In reply to Stefan Weil

Am 06.02.2015 um 21:52 schrieb Stefan Weil:

Quoted 10 lines

Warning from the Sparse static analysis tool:

stubs/vmstate.c:4:26: warning:
symbol 'vmstate_dummy' was not declared. Should it be static?

Cc Juan Quintela <[email protected]>
Cc Amit Shah <[email protected]>

---

Sorry, I just noticed that I have sent several patches with a wrong mailing address [email protected] instead of [email protected]. I'll resend those patches in a series with correct address.

Stefan