From 69190094ad209b2d9091d7c2ca90ac7d49382d61 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Mon, 16 Sep 2019 10:50:04 +0200 Subject: [PATCH] hla: improve readability of struct hl_interface_s initialization The initialization is barely readable, while actually only few fields are set with value nor zero nor NULL. Rewrite the initialization using C99 struct designations. Change-Id: I4d288e6536ebe7110a184db6540223fc67361ec3 Signed-off-by: Antonio Borneo Reviewed-on: https://review.openocd.org/c/openocd/+/6636 Tested-by: jenkins Reviewed-by: Tomas Vanek --- src/jtag/hla/hla_interface.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/jtag/hla/hla_interface.c b/src/jtag/hla/hla_interface.c index b16a930a99..fc362c0408 100644 --- a/src/jtag/hla/hla_interface.c +++ b/src/jtag/hla/hla_interface.c @@ -35,7 +35,21 @@ #include -static struct hl_interface_s hl_if = { {0, 0, { 0 }, { 0 }, HL_TRANSPORT_UNKNOWN, false, -1, false, 7184}, 0, 0 }; +static struct hl_interface_s hl_if = { + .param = { + .device_desc = NULL, + .serial = NULL, + .vid = { 0 }, + .pid = { 0 }, + .transport = HL_TRANSPORT_UNKNOWN, + .connect_under_reset = false, + .initial_interface_speed = -1, + .use_stlink_tcp = false, + .stlink_tcp_port = 7184, + }, + .layout = NULL, + .handle = NULL, +}; int hl_interface_open(enum hl_transports tr) { -- 2.30.2