From: Antonio Borneo Date: Mon, 16 Sep 2019 08:50:04 +0000 (+0200) Subject: hla: improve readability of struct hl_interface_s initialization X-Git-Tag: v0.12.0-rc1~470 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=69190094ad209b2d9091d7c2ca90ac7d49382d61 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 --- 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) {