Skip to content

Commit

Permalink
driver: mpsse: make local functions static
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8544
Tested-by: jenkins
  • Loading branch information
borneoa committed Nov 23, 2024
1 parent f4ac0c7 commit 644742b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/jtag/drivers/mpsse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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("-");
Expand Down Expand Up @@ -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);

Expand All @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/jtag/drivers/mpsse.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,12 @@ 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. */
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 */

0 comments on commit 644742b

Please sign in to comment.