From: openocd-gerrit <ope...@us...> - 2025-02-16 16:22:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 54d07de86ea6abf1123cc2b032316f0c1bb88b3e (commit) via 8a5c3318315324574196ae3320c7abf326d4df88 (commit) from 894a39eda30c1b0e8eff39b687333deb4b3b0891 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 54d07de86ea6abf1123cc2b032316f0c1bb88b3e Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:25:15 2025 +0100 jtag: bitbang: drop useless typedef bb_value_t No need to use a typedef for an enum. Drop it. Change-Id: I8800c95f97d2bafe27c699d7d451fb9b54286d99 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8707 Tested-by: jenkins diff --git a/src/jtag/drivers/am335xgpio.c b/src/jtag/drivers/am335xgpio.c index 05a73aa53..cacf4e7c7 100644 --- a/src/jtag/drivers/am335xgpio.c +++ b/src/jtag/drivers/am335xgpio.c @@ -206,7 +206,7 @@ static void restore_gpio(enum adapter_gpio_config_index idx) } } -static bb_value_t am335xgpio_read(void) +static enum bb_value am335xgpio_read(void) { return get_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_TDO]) ? BB_HIGH : BB_LOW; } diff --git a/src/jtag/drivers/at91rm9200.c b/src/jtag/drivers/at91rm9200.c index 57dd54c11..a77e29aa6 100644 --- a/src/jtag/drivers/at91rm9200.c +++ b/src/jtag/drivers/at91rm9200.c @@ -98,7 +98,7 @@ static uint32_t *pio_base; /* low level command set */ -static bb_value_t at91rm9200_read(void); +static enum bb_value at91rm9200_read(void); static int at91rm9200_write(int tck, int tms, int tdi); static int at91rm9200_init(void); @@ -110,7 +110,7 @@ static const struct bitbang_interface at91rm9200_bitbang = { .blink = NULL, }; -static bb_value_t at91rm9200_read(void) +static enum bb_value at91rm9200_read(void) { return (pio_base[device->TDO_PIO + PIO_PDSR] & device->TDO_MASK) ? BB_HIGH : BB_LOW; } diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c index 2c2061dae..095601fa6 100644 --- a/src/jtag/drivers/bcm2835gpio.c +++ b/src/jtag/drivers/bcm2835gpio.c @@ -182,7 +182,7 @@ static void initialize_gpio(enum adapter_gpio_config_index idx) bcm2835_gpio_synchronize(); } -static bb_value_t bcm2835gpio_read(void) +static enum bb_value bcm2835gpio_read(void) { unsigned int shift = adapter_gpio_config[ADAPTER_GPIO_IDX_TDO].gpio_num; uint32_t value = (GPIO_LEV >> shift) & 1; diff --git a/src/jtag/drivers/bitbang.h b/src/jtag/drivers/bitbang.h index d6fd95e27..6afa409e9 100644 --- a/src/jtag/drivers/bitbang.h +++ b/src/jtag/drivers/bitbang.h @@ -14,11 +14,11 @@ #include <jtag/swd.h> #include <jtag/commands.h> -typedef enum { +enum bb_value { BB_LOW, BB_HIGH, BB_ERROR -} bb_value_t; +}; /** Low level callbacks (for bitbang). * @@ -29,7 +29,7 @@ typedef enum { * increase throughput. */ struct bitbang_interface { /** Sample TDO and return the value. */ - bb_value_t (*read)(void); + enum bb_value (*read)(void); /** The number of TDO samples that can be buffered up before the caller has * to call read_sample. */ @@ -39,7 +39,7 @@ struct bitbang_interface { int (*sample)(void); /** Return the next unread value from the buffer. */ - bb_value_t (*read_sample)(void); + enum bb_value (*read_sample)(void); /** Set TCK, TMS, and TDI to the given values. */ int (*write)(int tck, int tms, int tdi); diff --git a/src/jtag/drivers/dummy.c b/src/jtag/drivers/dummy.c index 315e03697..bfd6e8c54 100644 --- a/src/jtag/drivers/dummy.c +++ b/src/jtag/drivers/dummy.c @@ -22,7 +22,7 @@ static int clock_count; /* count clocks in any stable state, only stable states static uint32_t dummy_data; -static bb_value_t dummy_read(void) +static enum bb_value dummy_read(void) { int data = 1 & dummy_data; dummy_data = (dummy_data >> 1) | (1 << 31); diff --git a/src/jtag/drivers/ep93xx.c b/src/jtag/drivers/ep93xx.c index ae35f4ac0..ea9faf19b 100644 --- a/src/jtag/drivers/ep93xx.c +++ b/src/jtag/drivers/ep93xx.c @@ -30,7 +30,7 @@ static volatile uint8_t *gpio_data_direction_register; /* low level command set */ -static bb_value_t ep93xx_read(void); +static enum bb_value ep93xx_read(void); static int ep93xx_write(int tck, int tms, int tdi); static int ep93xx_reset(int trst, int srst); @@ -61,7 +61,7 @@ static const struct bitbang_interface ep93xx_bitbang = { .blink = NULL, }; -static bb_value_t ep93xx_read(void) +static enum bb_value ep93xx_read(void) { return (*gpio_data_register & TDO_BIT) ? BB_HIGH : BB_LOW; } diff --git a/src/jtag/drivers/imx_gpio.c b/src/jtag/drivers/imx_gpio.c index 7aefbeb8a..18dc2ddf6 100644 --- a/src/jtag/drivers/imx_gpio.c +++ b/src/jtag/drivers/imx_gpio.c @@ -72,7 +72,7 @@ static inline bool gpio_level(int g) return pio_base[g / 32].dr >> (g & 0x1F) & 1; } -static bb_value_t imx_gpio_read(void); +static enum bb_value imx_gpio_read(void); static int imx_gpio_write(int tck, int tms, int tdi); static int imx_gpio_swdio_read(void); @@ -118,7 +118,7 @@ static int speed_coeff = 50000; static int speed_offset = 100; static unsigned int jtag_delay; -static bb_value_t imx_gpio_read(void) +static enum bb_value imx_gpio_read(void) { return gpio_level(tdo_gpio) ? BB_HIGH : BB_LOW; } diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index 5ffbf4d2f..eda7b1a80 100644 --- a/src/jtag/drivers/linuxgpiod.c +++ b/src/jtag/drivers/linuxgpiod.c @@ -42,7 +42,7 @@ static bool is_gpio_config_valid(enum adapter_gpio_config_index idx) } /* Bitbang interface read of TDO */ -static bb_value_t linuxgpiod_read(void) +static enum bb_value linuxgpiod_read(void) { int retval; diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index f3478db51..3b20fe247 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -115,7 +115,7 @@ static unsigned long dataport; static unsigned long statusport; #endif -static bb_value_t parport_read(void) +static enum bb_value parport_read(void) { int data = 0; diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index 66f995d57..bb608ba0a 100644 --- a/src/jtag/drivers/remote_bitbang.c +++ b/src/jtag/drivers/remote_bitbang.c @@ -176,7 +176,7 @@ static int remote_bitbang_quit(void) return ERROR_OK; } -static bb_value_t char_to_int(int c) +static enum bb_value char_to_int(int c) { switch (c) { case '0': @@ -198,7 +198,7 @@ static int remote_bitbang_sample(void) return remote_bitbang_queue('R', NO_FLUSH); } -static bb_value_t remote_bitbang_read_sample(void) +static enum bb_value remote_bitbang_read_sample(void) { if (remote_bitbang_recv_buf_empty()) { if (remote_bitbang_fill_buf(BLOCK) != ERROR_OK) diff --git a/src/jtag/drivers/sysfsgpio.c b/src/jtag/drivers/sysfsgpio.c index c47754bd1..ccd3974a4 100644 --- a/src/jtag/drivers/sysfsgpio.c +++ b/src/jtag/drivers/sysfsgpio.c @@ -255,7 +255,7 @@ static int sysfsgpio_swd_write(int swclk, int swdio) * The sysfs value will read back either '0' or '1'. The trick here is to call * lseek to bypass buffering in the sysfs kernel driver. */ -static bb_value_t sysfsgpio_read(void) +static enum bb_value sysfsgpio_read(void) { char buf[1]; commit 8a5c3318315324574196ae3320c7abf326d4df88 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:22:17 2025 +0100 jtag: remote_bitbang: drop useless typedef flush_bool_t No need to use a typedef for an enum. Drop it. Change-Id: I122784ddd7b81ccd86da258b08526685c3d70033 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8706 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index 037c1f27f..66f995d57 100644 --- a/src/jtag/drivers/remote_bitbang.c +++ b/src/jtag/drivers/remote_bitbang.c @@ -145,12 +145,12 @@ static int remote_bitbang_fill_buf(enum block_bool block) return ERROR_OK; } -typedef enum { +enum flush_bool { NO_FLUSH, FLUSH_SEND_BUF -} flush_bool_t; +}; -static int remote_bitbang_queue(int c, flush_bool_t flush) +static int remote_bitbang_queue(int c, enum flush_bool flush) { remote_bitbang_send_buf[remote_bitbang_send_buf_used++] = c; if (flush == FLUSH_SEND_BUF || ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/am335xgpio.c | 2 +- src/jtag/drivers/at91rm9200.c | 4 ++-- src/jtag/drivers/bcm2835gpio.c | 2 +- src/jtag/drivers/bitbang.h | 8 ++++---- src/jtag/drivers/dummy.c | 2 +- src/jtag/drivers/ep93xx.c | 4 ++-- src/jtag/drivers/imx_gpio.c | 4 ++-- src/jtag/drivers/linuxgpiod.c | 2 +- src/jtag/drivers/parport.c | 2 +- src/jtag/drivers/remote_bitbang.c | 10 +++++----- src/jtag/drivers/sysfsgpio.c | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) hooks/post-receive -- Main OpenOCD repository |