rtt: drop useless typedefs

There is no need to use extra typedef for the rtt functions.
Declare the type of the functions in the struct.

Change-Id: Idf2fee6e63ec3b3add38d042bbebe8d74613627c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8698
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
This commit is contained in:
Antonio Borneo 2025-01-10 12:13:30 +01:00
parent 73e9b7898f
commit 6e39af3b0e
1 changed files with 9 additions and 17 deletions

View File

@ -95,35 +95,27 @@ enum rtt_channel_type {
RTT_CHANNEL_TYPE_DOWN
};
typedef int (*rtt_source_find_ctrl_block)(struct target *target,
/** RTT source. */
struct rtt_source {
int (*find_cb)(struct target *target,
target_addr_t *address, size_t size, const char *id, bool *found,
void *user_data);
typedef int (*rtt_source_read_ctrl_block)(struct target *target,
int (*read_cb)(struct target *target,
target_addr_t address, struct rtt_control *ctrl_block,
void *user_data);
typedef int (*rtt_source_read_channel_info)(struct target *target,
int (*read_channel_info)(struct target *target,
const struct rtt_control *ctrl, unsigned int channel,
enum rtt_channel_type type, struct rtt_channel_info *info,
void *user_data);
typedef int (*rtt_source_start)(struct target *target,
int (*start)(struct target *target,
const struct rtt_control *ctrl, void *user_data);
typedef int (*rtt_source_stop)(struct target *target, void *user_data);
typedef int (*rtt_source_read)(struct target *target,
int (*stop)(struct target *target, void *user_data);
int (*read)(struct target *target,
const struct rtt_control *ctrl, struct rtt_sink_list **sinks,
size_t num_channels, void *user_data);
typedef int (*rtt_source_write)(struct target *target,
int (*write)(struct target *target,
struct rtt_control *ctrl, unsigned int channel,
const uint8_t *buffer, size_t *length, void *user_data);
/** RTT source. */
struct rtt_source {
rtt_source_find_ctrl_block find_cb;
rtt_source_read_ctrl_block read_cb;
rtt_source_read_channel_info read_channel_info;
rtt_source_start start;
rtt_source_stop stop;
rtt_source_read read;
rtt_source_write write;
};
/**