From 644742b4b218eefd855dc636ccea25b769e80315 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Sat, 9 Nov 2024 19:33:58 +0100 Subject: [PATCH] driver: mpsse: make local functions static The functions: - mpsse_divide_by_5_config(); - mpsse_purge(); - mpsse_rtck_config(); - mpsse_set_divisor(); are not referenced outside the file. Make them static. Change-Id: Id6930183a3ce26693b2113f622046168ba289df8 Signed-off-by: Antonio Borneo Reviewed-on: https://review.openocd.org/c/openocd/+/8544 Tested-by: jenkins --- src/jtag/drivers/mpsse.c | 10 ++++++---- src/jtag/drivers/mpsse.h | 4 ---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/jtag/drivers/mpsse.c b/src/jtag/drivers/mpsse.c index 1ef9550a0..38393ad0a 100644 --- a/src/jtag/drivers/mpsse.c +++ b/src/jtag/drivers/mpsse.c @@ -75,6 +75,8 @@ struct mpsse_ctx { int retval; }; +static void mpsse_purge(struct mpsse_ctx *ctx); + /* Returns true if the string descriptor indexed by str_index in device matches string */ static bool string_descriptor_equal(struct libusb_device_handle *device, uint8_t str_index, const char *string) @@ -421,7 +423,7 @@ bool mpsse_is_high_speed(struct mpsse_ctx *ctx) return ctx->type != TYPE_FT2232C; } -void mpsse_purge(struct mpsse_ctx *ctx) +static void mpsse_purge(struct mpsse_ctx *ctx) { int err; LOG_DEBUG("-"); @@ -709,7 +711,7 @@ void mpsse_loopback_config(struct mpsse_ctx *ctx, bool enable) single_byte_boolean_helper(ctx, enable, 0x84, 0x85); } -void mpsse_set_divisor(struct mpsse_ctx *ctx, uint16_t divisor) +static void mpsse_set_divisor(struct mpsse_ctx *ctx, uint16_t divisor) { LOG_DEBUG("%d", divisor); @@ -726,7 +728,7 @@ void mpsse_set_divisor(struct mpsse_ctx *ctx, uint16_t divisor) buffer_write_byte(ctx, divisor >> 8); } -int mpsse_divide_by_5_config(struct mpsse_ctx *ctx, bool enable) +static int mpsse_divide_by_5_config(struct mpsse_ctx *ctx, bool enable) { if (!mpsse_is_high_speed(ctx)) return ERROR_FAIL; @@ -737,7 +739,7 @@ int mpsse_divide_by_5_config(struct mpsse_ctx *ctx, bool enable) return ERROR_OK; } -int mpsse_rtck_config(struct mpsse_ctx *ctx, bool enable) +static int mpsse_rtck_config(struct mpsse_ctx *ctx, bool enable) { if (!mpsse_is_high_speed(ctx)) return ERROR_FAIL; diff --git a/src/jtag/drivers/mpsse.h b/src/jtag/drivers/mpsse.h index 4a625d890..e95f842c9 100644 --- a/src/jtag/drivers/mpsse.h +++ b/src/jtag/drivers/mpsse.h @@ -59,9 +59,6 @@ void mpsse_set_data_bits_high_byte(struct mpsse_ctx *ctx, uint8_t data, uint8_t void mpsse_read_data_bits_low_byte(struct mpsse_ctx *ctx, uint8_t *data); void mpsse_read_data_bits_high_byte(struct mpsse_ctx *ctx, uint8_t *data); void mpsse_loopback_config(struct mpsse_ctx *ctx, bool enable); -void mpsse_set_divisor(struct mpsse_ctx *ctx, uint16_t divisor); -int mpsse_divide_by_5_config(struct mpsse_ctx *ctx, bool enable); -int mpsse_rtck_config(struct mpsse_ctx *ctx, bool enable); /* Helper to set frequency in Hertz. Returns actual realizable frequency or negative error. * Frequency 0 means RTCK. */ @@ -69,6 +66,5 @@ int mpsse_set_frequency(struct mpsse_ctx *ctx, int frequency); /* Queue handling */ int mpsse_flush(struct mpsse_ctx *ctx); -void mpsse_purge(struct mpsse_ctx *ctx); #endif /* OPENOCD_JTAG_DRIVERS_MPSSE_H */