git: ad152571b8fd - main - bhyve uart: Fix errors from GCC
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 02 Oct 2024 21:41:14 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=ad152571b8fd69d93ca0e44d80c9b49308b36eae
commit ad152571b8fd69d93ca0e44d80c9b49308b36eae
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-10-02 21:31:59 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-10-02 21:31:59 +0000
bhyve uart: Fix errors from GCC
- Place 'static' before other qualifiers (-Wold-style-declaration)
- Correct the order of arguments to calloc (-Wcalloc-transposed-args)
Reported by: GCC 14
Fixes: 1f903953fbf8 bhyve: Add raw tcp to uart backend
---
usr.sbin/bhyve/uart_backend.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/usr.sbin/bhyve/uart_backend.c b/usr.sbin/bhyve/uart_backend.c
index a09764190137..32490105fecf 100644
--- a/usr.sbin/bhyve/uart_backend.c
+++ b/usr.sbin/bhyve/uart_backend.c
@@ -293,7 +293,7 @@ done:
static void
uart_tcp_listener(int fd, enum ev_type type __unused, void *arg)
{
- const static char tcp_error_msg[] = "Socket already connected\n";
+ static const char tcp_error_msg[] = "Socket already connected\n";
struct uart_socket_softc *socket_softc = (struct uart_socket_softc *)
arg;
struct uart_softc *sc = socket_softc->softc;
@@ -473,7 +473,7 @@ uart_tcp_backend(struct uart_softc *sc, const char *path,
* Set the connection softc structure, which includes both the softc
* and the drain function provided by the frontend.
*/
- if ((socket_softc = calloc(sizeof(struct uart_socket_softc), 1)) ==
+ if ((socket_softc = calloc(1, sizeof(struct uart_socket_softc))) ==
NULL)
goto clean;