From a27661cd0bc73d0725e8d7b6f595817947fd8ca8 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Thu, 14 Apr 2022 14:20:59 -0400 Subject: [PATCH] hosted/platform: Formatting consistency improvements --- src/platforms/hosted/platform.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/platforms/hosted/platform.c b/src/platforms/hosted/platform.c index a90294d..84a76c6 100644 --- a/src/platforms/hosted/platform.c +++ b/src/platforms/hosted/platform.c @@ -76,11 +76,10 @@ void platform_init(int argc, char **argv) atexit(exit_function); signal(SIGTERM, sigterm_handler); signal(SIGINT, sigterm_handler); - if (cl_opts.opt_device) { + if (cl_opts.opt_device) info.bmp_type = BMP_TYPE_BMP; - } else if (find_debuggers(&cl_opts, &info)) { + else if (find_debuggers(&cl_opts, &info)) exit(-1); - } bmp_ident(&info); switch (info.bmp_type) { case BMP_TYPE_BMP: @@ -89,11 +88,11 @@ void platform_init(int argc, char **argv) remote_init(); break; case BMP_TYPE_STLINKV2: - if (stlink_init( &info)) + if (stlink_init(&info)) exit(-1); break; case BMP_TYPE_CMSIS_DAP: - if (dap_init( &info)) + if (dap_init(&info)) exit(-1); break; case BMP_TYPE_LIBFTDI: @@ -107,14 +106,12 @@ void platform_init(int argc, char **argv) default: exit(-1); } - int ret = -1; - if (cl_opts.opt_mode != BMP_MODE_DEBUG) { - ret = cl_execute(&cl_opts); - } else { + if (cl_opts.opt_mode != BMP_MODE_DEBUG) + exit(cl_execute(&cl_opts)); + else { gdb_if_init(); return; } - exit(ret); } int platform_adiv5_swdp_scan(uint32_t targetid)