]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
jtag: bitbang: drop useless typedef bb_value_t
authorAntonio Borneo <borneo.antonio@gmail.com>
Fri, 10 Jan 2025 14:25:15 +0000 (15:25 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 16 Feb 2025 16:22:33 +0000 (16:22 +0000)
No need to use a typedef for an enum.
Drop it.

Change-Id: I8800c95f97d2bafe27c699d7d451fb9b54286d99
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8707
Tested-by: jenkins
src/jtag/drivers/am335xgpio.c
src/jtag/drivers/at91rm9200.c
src/jtag/drivers/bcm2835gpio.c
src/jtag/drivers/bitbang.h
src/jtag/drivers/dummy.c
src/jtag/drivers/ep93xx.c
src/jtag/drivers/imx_gpio.c
src/jtag/drivers/linuxgpiod.c
src/jtag/drivers/parport.c
src/jtag/drivers/remote_bitbang.c
src/jtag/drivers/sysfsgpio.c

index 05a73aa53ce92306f833aabaab0fa8fbeccf64ec..cacf4e7c796ee18455442efe6eeb71ba914ed78a 100644 (file)
@@ -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;
 }
index 57dd54c119cc7d93d1d3e3772c1684f7cd892afd..a77e29aa6e544f2f950378c9ef86680d86ae80bc 100644 (file)
@@ -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;
 }
index 2c2061daec99df9630ce933aaad2a35d06b9002a..095601fa61e87b42b2eba25f6db9d20b304be985 100644 (file)
@@ -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;
index d6fd95e27980ea04ad9c8b03d18a443333d59f97..6afa409e989322f935edb14c85ceeae044ef6a62 100644 (file)
 #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);
index 315e03697485c20d5ee291f33bfa01f62b5eaebb..bfd6e8c54d14c821d74d53c6e09ab91fe2af74c9 100644 (file)
@@ -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);
index ae35f4ac0ce30cd018e8b88c4a22bcfe06dd4efb..ea9faf19b733a2fc53efec4af9fb50801bc38b60 100644 (file)
@@ -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;
 }
index 7aefbeb8aa3cf195341ff81d8526412fe32c115d..18dc2ddf6761943a89bb5a160c2cd67525a7f490 100644 (file)
@@ -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;
 }
index 5ffbf4d2f210939ad5a136346a66dcdeb178d762..eda7b1a80e17fd049bfee180123e43ab1727cff5 100644 (file)
@@ -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;
 
index f3478db51e576e2e13df3d02e8eb3731bdb1d680..3b20fe247821d49a5041de59779f3af4f2aa1772 100644 (file)
@@ -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;
 
index 66f995d57434335d9ac2e7afcea487d2d063c358..bb608ba0a5cb648bcb4aee1b4945f36bb3906534 100644 (file)
@@ -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)
index c47754bd198d91bab26eb928e8e2de9bd04a2a3a..ccd3974a42399008f5d9be59e005304f1b75dc90 100644 (file)
@@ -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];