[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 08/18] ui: Clean up a few things checkpatch.pl would flag late
From: |
Markus Armbruster |
Subject: |
[PATCH v3 08/18] ui: Clean up a few things checkpatch.pl would flag later on |
Date: |
Tue, 20 Dec 2022 10:06:35 +0100 |
Fix a few style violations so that checkpatch.pl won't complain when I
move this code.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
monitor/hmp-cmds.c | 7 ++++---
monitor/qmp-cmds.c | 21 +++++++++++----------
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 4d57520f82..5b41225bb9 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -587,9 +587,10 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)
hmp_info_vnc_servers(mon, info->server);
hmp_info_vnc_clients(mon, info->clients);
if (!info->server) {
- /* The server entry displays its auth, we only
- * need to display in the case of 'reverse' connections
- * where there's no server.
+ /*
+ * The server entry displays its auth, we only need to
+ * display in the case of 'reverse' connections where
+ * there's no server.
*/
hmp_info_vnc_authcrypt(mon, " ", info->auth,
info->has_vencrypt ? &info->vencrypt : NULL);
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index a1695b6c96..6d6df86607 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -186,8 +186,10 @@ void qmp_set_password(SetPasswordOptions *opts, Error
**errp)
error_setg(errp, QERR_INVALID_PARAMETER, "connected");
return;
}
- /* Note that setting an empty password will not disable login through
- * this interface. */
+ /*
+ * Note that setting an empty password will not disable login
+ * through this interface.
+ */
rc = vnc_display_password(opts->u.vnc.display, opts->password);
}
@@ -272,12 +274,10 @@ void qmp_add_client(const char *protocol, const char
*fdname,
error_setg(errp, "spice failed to add client");
close(fd);
}
- return;
#ifdef CONFIG_VNC
} else if (strcmp(protocol, "vnc") == 0) {
skipauth = has_skipauth ? skipauth : false;
vnc_display_add_client(NULL, fd, skipauth);
- return;
#endif
#ifdef CONFIG_DBUS_DISPLAY
} else if (strcmp(protocol, "@dbus-display") == 0) {
@@ -289,19 +289,20 @@ void qmp_add_client(const char *protocol, const char
*fdname,
close(fd);
return;
}
- return;
#endif
- } else if ((s = qemu_chr_find(protocol)) != NULL) {
+ } else {
+ s = qemu_chr_find(protocol);
+ if (!s) {
+ error_setg(errp, "protocol '%s' is invalid", protocol);
+ close(fd);
+ return;
+ }
if (qemu_chr_add_client(s, fd) < 0) {
error_setg(errp, "failed to add client");
close(fd);
return;
}
- return;
}
-
- error_setg(errp, "protocol '%s' is invalid", protocol);
- close(fd);
}
--
2.38.1
- [PATCH v3 07/18] ui/spice: Give hmp_info_spice()'s channel_names[] static linkage, (continued)
- [PATCH v3 07/18] ui/spice: Give hmp_info_spice()'s channel_names[] static linkage, Markus Armbruster, 2022/12/20
- [PATCH v3 06/18] ui/spice: QXLInterface method set_mm_time() is now dead, drop, Markus Armbruster, 2022/12/20
- [PATCH v3 03/18] ui/spice: Require spice-protocol >= 0.14.0, Markus Armbruster, 2022/12/20
- [PATCH v3 14/18] ui: Factor out hmp_change_vnc(), and move to ui/ui-hmp-cmds.c, Markus Armbruster, 2022/12/20
- [PATCH v3 15/18] ui: Reduce nesting in hmp_change_vnc() slightly, Markus Armbruster, 2022/12/20
- [PATCH v3 12/18] ui: Move more HMP commands from monitor to ui/, Markus Armbruster, 2022/12/20
- [PATCH v3 05/18] ui/spice: Require spice-server >= 0.14.0, Markus Armbruster, 2022/12/20
- [PATCH v3 11/18] ui: Move HMP commands from monitor to new ui/ui-hmp-cmds.c, Markus Armbruster, 2022/12/20
- [PATCH v3 08/18] ui: Clean up a few things checkpatch.pl would flag later on,
Markus Armbruster <=
- [PATCH v3 17/18] ui: Don't check for mode change after mouse_set error, Markus Armbruster, 2022/12/20
- [PATCH v3 16/18] ui: Split hmp_mouse_set() and move the HMP part to ui/, Markus Armbruster, 2022/12/20
- Re: [PATCH v3 00/18] ui: Move and clean up monitor command code, Philippe Mathieu-Daudé, 2022/12/20