[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 8/9] hw/misc/pca9552: Replace g_newa() by g_new()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 8/9] hw/misc/pca9552: Replace g_newa() by g_new() |
Date: |
Thu, 6 May 2021 15:37:57 +0200 |
The ALLOCA(3) man-page mentions its "use is discouraged".
Replace the g_newa() call by g_new().
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/misc/pca9552.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c
index b7686e27d7f..facf103cbfb 100644
--- a/hw/misc/pca9552.c
+++ b/hw/misc/pca9552.c
@@ -71,7 +71,7 @@ static void pca955x_display_pins_status(PCA955xState *s,
return;
}
if (trace_event_get_state_backends(TRACE_PCA955X_GPIO_STATUS)) {
- char *buf = g_newa(char, k->pin_count + 1);
+ g_autofree char *buf = g_new(char, k->pin_count + 1);
for (i = 0; i < k->pin_count; i++) {
if (extract32(pins_status, i, 1)) {
--
2.26.3
[PATCH v2 5/9] gdbstub: Constify GdbCmdParseEntry, Philippe Mathieu-Daudé, 2021/05/06
[PATCH v2 6/9] gdbstub: Only call cmd_parse_params() with non-NULL command schema, Philippe Mathieu-Daudé, 2021/05/06
[PATCH v2 7/9] gdbstub: Replace alloca() + memset(0) by g_new0(), Philippe Mathieu-Daudé, 2021/05/06
[PATCH v2 8/9] hw/misc/pca9552: Replace g_newa() by g_new(),
Philippe Mathieu-Daudé <=
[PATCH v2 9/9] target/ppc/kvm: Replace alloca() by g_malloc(), Philippe Mathieu-Daudé, 2021/05/06
Re: [PATCH v2 0/9] misc: Replace alloca() by g_malloc(), Warner Losh, 2021/05/06