From: Alexander Kurz Date: Sun, 14 Feb 2016 09:04:51 +0000 (+0100) Subject: jtag ulink: dont compile function when not required X-Git-Tag: v0.10.0-rc1~179 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=17ec0b1044685d2da44c6992870b749e0009b83a;p=openocd jtag ulink: dont compile function when not required ulink_calculate_frequency() is used exclusively when _DEBUG_JTAG_IO_ is set, no need to compile this function if it is not used. Declaring it static in the same commit. Change-Id: I243ffdf69a1dc3bee6d16e4bb8d78396b6ea5144 Signed-off-by: Alexander Kurz Reviewed-on: http://openocd.zylin.com/3241 Tested-by: jenkins Reviewed-by: Andreas Fritiofson --- diff --git a/src/jtag/drivers/ulink.c b/src/jtag/drivers/ulink.c index cfd693a6..130ade35 100644 --- a/src/jtag/drivers/ulink.c +++ b/src/jtag/drivers/ulink.c @@ -193,6 +193,7 @@ int ulink_execute_queued_commands(struct ulink *device, int timeout); const char *ulink_cmd_id_string(uint8_t id); void ulink_print_command(struct ulink_cmd *ulink_cmd); void ulink_print_queue(struct ulink *device); +static int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f); #endif int ulink_append_scan_cmd(struct ulink *device, @@ -225,7 +226,6 @@ int ulink_append_test_cmd(struct ulink *device); /* OpenULINK TCK frequency helper functions */ int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay); -int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f); /* Interface between OpenULINK and OpenOCD */ static void ulink_set_end_state(tap_state_t endstate); @@ -1369,6 +1369,7 @@ int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay) return ERROR_OK; } +#ifdef _DEBUG_JTAG_IO_ /** * Calculate frequency for a given delay value. * @@ -1383,7 +1384,7 @@ int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay) * @return on success: ERROR_OK * @return on failure: ERROR_FAIL */ -int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f) +static int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f) { float t, f_float, f_rounded; @@ -1432,6 +1433,7 @@ int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f) return ERROR_OK; } +#endif /******************* Interface between OpenULINK and OpenOCD ******************/