X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Fetb.c;h=7cd8b6cd5c8997c2147cc395661dbf2622b64b77;hp=2ab35027169f4701dd81af97f01fd9c766b7021a;hb=57962f4d1c2db12dffa03c7357f5d7e0d8f71fb8;hpb=009f5c2af0b35d8551aa422475482d2da09675f2 diff --git a/src/target/etb.c b/src/target/etb.c index 2ab3502716..7cd8b6cd5c 100644 --- a/src/target/etb.c +++ b/src/target/etb.c @@ -13,9 +13,7 @@ * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + * along with this program. If not, see . * ***************************************************************************/ #ifdef HAVE_CONFIG_H @@ -27,7 +25,7 @@ #include "etb.h" #include "register.h" -static char *etb_reg_list[] = { +static const char * const etb_reg_list[] = { "ETB_identification", "ETB_ram_depth", "ETB_ram_width", @@ -145,8 +143,8 @@ struct reg_cache *etb_build_reg_cache(struct etb *etb) for (i = 0; i < num_regs; i++) { reg_list[i].name = etb_reg_list[i]; reg_list[i].size = 32; - reg_list[i].dirty = 0; - reg_list[i].valid = 0; + reg_list[i].dirty = false; + reg_list[i].valid = false; reg_list[i].value = calloc(1, 4); reg_list[i].arch_info = &arch_info[i]; reg_list[i].type = &etb_reg_type; @@ -274,8 +272,8 @@ static int etb_set_reg(struct reg *reg, uint32_t value) } buf_set_u32(reg->value, 0, reg->size, value); - reg->valid = 1; - reg->dirty = 0; + reg->valid = true; + reg->dirty = false; return ERROR_OK; } @@ -308,7 +306,7 @@ static int etb_write_reg(struct reg *reg, uint32_t value) fields[0].num_bits = 32; uint8_t temp0[4]; fields[0].out_value = temp0; - buf_set_u32(&temp0, 0, 32, value); + buf_set_u32(temp0, 0, 32, value); fields[0].in_value = NULL; fields[1].num_bits = 7; @@ -443,6 +441,7 @@ static const struct command_registration etb_command_handlers[] = { .mode = COMMAND_ANY, .help = "Embedded Trace Buffer command group", .chain = etb_config_command_handlers, + .usage = "", }, COMMAND_REGISTRATION_DONE };