Skip to contentSkip to conversation

vl.c: Don't zero-initialize statics for serial_hds

PATCH In review Peter Maydell 2 participants 5 messages Apr 26, 2018 – Jun 22, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vl.c: Don't zero-initialize statics for serial_hds

checkpatch reminds us that statics shouldn't be zero-initialized:

ERROR: do not initialise statics to 0 or NULL
#35: FILE: vl.c:157:
+static int num_serial_hds = 0;

ERROR: do not initialise statics to 0 or NULL
#36: FILE: vl.c:158:
+static Chardev **serial_hds = NULL;

I forgot to fix this in 6af2692e86f9fdfb3d; do so now.

---
I wouldn't bother with this except that I forgot to fold it in when applying the serial-limits patchset.

 vl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
vl.c +2 -2
index 616956adf1..6d8b869dad 100644
@@ -154,8 +154,8 @@ QEMUClockType rtc_clock;
 int vga_interface_type = VGA_NONE;
 static DisplayOptions dpy;
 int no_frame;
-static int num_serial_hds = 0;
-static Chardev **serial_hds = NULL;
+static int num_serial_hds;
+static Chardev **serial_hds;
 Chardev *parallel_hds[MAX_PARALLEL_PORTS];
 Chardev *virtcon_hds[MAX_VIRTIO_CONSOLES];
 Chardev *sclp_hds[MAX_SCLP_CONSOLES];
Signature · 1 line
2.17.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Peter Maydell

checkpatch reminds us that statics shouldn't be zero-initialized:

ERROR: do not initialise statics to 0 or NULL
#35: FILE: vl.c:157:
+static int num_serial_hds = 0;

ERROR: do not initialise statics to 0 or NULL
#36: FILE: vl.c:158:
+static Chardev **serial_hds = NULL;

I forgot to fix this in 6af2692e86f9fdfb3d; do so now.

---
I wouldn't bother with this except that I forgot to fold it in when applying the serial-limits patchset.

 vl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
vl.c +0 -0
index 616956adf1..6d8b869dad 100644

vl.c QEMUClockType rtc_clock; · line 161

Quoted 10 lines
vl.c +2 -2
@@ -154,8 +154,8 @@ QEMUClockType rtc_clock;
 int vga_interface_type = VGA_NONE;
 static DisplayOptions dpy;
 int no_frame;
-static int num_serial_hds = 0;
-static Chardev **serial_hds = NULL;
+static int num_serial_hds;
+static Chardev **serial_hds;
 Chardev *parallel_hds[MAX_PARALLEL_PORTS];
 Chardev *virtcon_hds[MAX_VIRTIO_CONSOLES];
 Chardev *sclp_hds[MAX_SCLP_CONSOLES];
#2 lore raw

Ping for application via qemu-trivial?

thanks
-- PMM

Quoted 39 lines · Thomas Huth
Quoted 26 lines · Peter Maydell

checkpatch reminds us that statics shouldn't be zero-initialized:

ERROR: do not initialise statics to 0 or NULL
#35: FILE: vl.c:157:
+static int num_serial_hds = 0;

ERROR: do not initialise statics to 0 or NULL
#36: FILE: vl.c:158:
+static Chardev **serial_hds = NULL;

I forgot to fix this in 6af2692e86f9fdfb3d; do so now.

---
I wouldn't bother with this except that I forgot to fold it in when applying the serial-limits patchset.

 vl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
vl.c +0 -0
index 616956adf1..6d8b869dad 100644

vl.c QEMUClockType rtc_clock; · line 161

Quoted 10 lines
vl.c +2 -2
@@ -154,8 +154,8 @@ QEMUClockType rtc_clock;
 int vga_interface_type = VGA_NONE;
 static DisplayOptions dpy;
 int no_frame;
-static int num_serial_hds = 0;
-static Chardev **serial_hds = NULL;
+static int num_serial_hds;
+static Chardev **serial_hds;
 Chardev *parallel_hds[MAX_PARALLEL_PORTS];
 Chardev *virtcon_hds[MAX_VIRTIO_CONSOLES];
 Chardev *sclp_hds[MAX_SCLP_CONSOLES];
#3 lore raw

Ping^2 for qemu-trivial?

thanks
-- PMM

Quoted 45 lines · Peter Maydell

Ping for application via qemu-trivial?

thanks
-- PMM

Quoted 39 lines · Thomas Huth
Quoted 26 lines · Peter Maydell

checkpatch reminds us that statics shouldn't be zero-initialized:

ERROR: do not initialise statics to 0 or NULL
#35: FILE: vl.c:157:
+static int num_serial_hds = 0;

ERROR: do not initialise statics to 0 or NULL
#36: FILE: vl.c:158:
+static Chardev **serial_hds = NULL;

I forgot to fix this in 6af2692e86f9fdfb3d; do so now.

---
I wouldn't bother with this except that I forgot to fold it in when applying the serial-limits patchset.

 vl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
vl.c +0 -0
index 616956adf1..6d8b869dad 100644

vl.c QEMUClockType rtc_clock; · line 161

Quoted 10 lines
vl.c +2 -2
@@ -154,8 +154,8 @@ QEMUClockType rtc_clock;
 int vga_interface_type = VGA_NONE;
 static DisplayOptions dpy;
 int no_frame;
-static int num_serial_hds = 0;
-static Chardev **serial_hds = NULL;
+static int num_serial_hds;
+static Chardev **serial_hds;
 Chardev *parallel_hds[MAX_PARALLEL_PORTS];
 Chardev *virtcon_hds[MAX_VIRTIO_CONSOLES];
 Chardev *sclp_hds[MAX_SCLP_CONSOLES];
#4 lore raw
Quoted 1 line · Peter Maydell

Ping^2 for qemu-trivial?

Gave up and threw it into the latest target-arm pullreq :-)

thanks
-- PMM