target: convert 'unsigned' to 'unsigned int'
Conversion done with checkpatch --fix-inplace -types UNSPECIFIED_INT Ignore the cast as they could be better addressed. Fix only minor additional checkpatch issue (spacing and line length). Use Checkpatch-ignore below for the function pointers in the file 'armv7a_cache_l2x.h' that do not assign the identifier names to the function arguments. Most of these struct are unused and should be fixed or dropped. Checkpatch-ignore: FUNCTION_ARGUMENTS Change-Id: I8f27e68eb3502e431c1ba801b362358105f9f2dc Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8480 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
This commit is contained in:
@@ -1443,14 +1443,14 @@ int target_gdb_fileio_end(struct target *target, int retcode, int fileio_errno,
|
||||
|
||||
target_addr_t target_address_max(struct target *target)
|
||||
{
|
||||
unsigned bits = target_address_bits(target);
|
||||
unsigned int bits = target_address_bits(target);
|
||||
if (sizeof(target_addr_t) * 8 == bits)
|
||||
return (target_addr_t) -1;
|
||||
else
|
||||
return (((target_addr_t) 1) << bits) - 1;
|
||||
}
|
||||
|
||||
unsigned target_address_bits(struct target *target)
|
||||
unsigned int target_address_bits(struct target *target)
|
||||
{
|
||||
if (target->type->address_bits)
|
||||
return target->type->address_bits(target);
|
||||
@@ -3035,7 +3035,7 @@ COMMAND_HANDLER(handle_reg_command)
|
||||
|
||||
unsigned int count = 0;
|
||||
while (cache) {
|
||||
unsigned i;
|
||||
unsigned int i;
|
||||
|
||||
command_print(CMD, "===== %s", cache->name);
|
||||
|
||||
@@ -3070,13 +3070,13 @@ COMMAND_HANDLER(handle_reg_command)
|
||||
|
||||
/* access a single register by its ordinal number */
|
||||
if ((CMD_ARGV[0][0] >= '0') && (CMD_ARGV[0][0] <= '9')) {
|
||||
unsigned num;
|
||||
unsigned int num;
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num);
|
||||
|
||||
struct reg_cache *cache = target->reg_cache;
|
||||
unsigned int count = 0;
|
||||
while (cache) {
|
||||
unsigned i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < cache->num_regs; i++) {
|
||||
if (count++ == num) {
|
||||
reg = &cache->reg_list[i];
|
||||
@@ -3194,7 +3194,7 @@ COMMAND_HANDLER(handle_wait_halt_command)
|
||||
if (CMD_ARGC > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
unsigned ms = DEFAULT_HALT_TIMEOUT;
|
||||
unsigned int ms = DEFAULT_HALT_TIMEOUT;
|
||||
if (1 == CMD_ARGC) {
|
||||
int retval = parse_uint(CMD_ARGV[0], &ms);
|
||||
if (retval != ERROR_OK)
|
||||
@@ -3260,7 +3260,7 @@ COMMAND_HANDLER(handle_halt_command)
|
||||
return retval;
|
||||
|
||||
if (CMD_ARGC == 1) {
|
||||
unsigned wait_local;
|
||||
unsigned int wait_local;
|
||||
retval = parse_uint(CMD_ARGV[0], &wait_local);
|
||||
if (retval != ERROR_OK)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -3344,14 +3344,14 @@ COMMAND_HANDLER(handle_step_command)
|
||||
}
|
||||
|
||||
void target_handle_md_output(struct command_invocation *cmd,
|
||||
struct target *target, target_addr_t address, unsigned size,
|
||||
unsigned count, const uint8_t *buffer)
|
||||
struct target *target, target_addr_t address, unsigned int size,
|
||||
unsigned int count, const uint8_t *buffer)
|
||||
{
|
||||
const unsigned line_bytecnt = 32;
|
||||
unsigned line_modulo = line_bytecnt / size;
|
||||
const unsigned int line_bytecnt = 32;
|
||||
unsigned int line_modulo = line_bytecnt / size;
|
||||
|
||||
char output[line_bytecnt * 4 + 1];
|
||||
unsigned output_len = 0;
|
||||
unsigned int output_len = 0;
|
||||
|
||||
const char *value_fmt;
|
||||
switch (size) {
|
||||
@@ -3373,7 +3373,7 @@ void target_handle_md_output(struct command_invocation *cmd,
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < count; i++) {
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
if (i % line_modulo == 0) {
|
||||
output_len += snprintf(output + output_len,
|
||||
sizeof(output) - output_len,
|
||||
@@ -3412,7 +3412,7 @@ COMMAND_HANDLER(handle_md_command)
|
||||
if (CMD_ARGC < 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
unsigned size = 0;
|
||||
unsigned int size = 0;
|
||||
switch (CMD_NAME[2]) {
|
||||
case 'd':
|
||||
size = 8;
|
||||
@@ -3445,7 +3445,7 @@ COMMAND_HANDLER(handle_md_command)
|
||||
target_addr_t address;
|
||||
COMMAND_PARSE_ADDRESS(CMD_ARGV[0], address);
|
||||
|
||||
unsigned count = 1;
|
||||
unsigned int count = 1;
|
||||
if (CMD_ARGC == 2)
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], count);
|
||||
|
||||
@@ -3471,22 +3471,22 @@ typedef int (*target_write_fn)(struct target *target,
|
||||
static int target_fill_mem(struct target *target,
|
||||
target_addr_t address,
|
||||
target_write_fn fn,
|
||||
unsigned data_size,
|
||||
unsigned int data_size,
|
||||
/* value */
|
||||
uint64_t b,
|
||||
/* count */
|
||||
unsigned c)
|
||||
unsigned int c)
|
||||
{
|
||||
/* We have to write in reasonably large chunks to be able
|
||||
* to fill large memory areas with any sane speed */
|
||||
const unsigned chunk_size = 16384;
|
||||
const unsigned int chunk_size = 16384;
|
||||
uint8_t *target_buf = malloc(chunk_size * data_size);
|
||||
if (!target_buf) {
|
||||
LOG_ERROR("Out of memory");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < chunk_size; i++) {
|
||||
for (unsigned int i = 0; i < chunk_size; i++) {
|
||||
switch (data_size) {
|
||||
case 8:
|
||||
target_buffer_set_u64(target, target_buf + i * data_size, b);
|
||||
@@ -3507,8 +3507,8 @@ static int target_fill_mem(struct target *target,
|
||||
|
||||
int retval = ERROR_OK;
|
||||
|
||||
for (unsigned x = 0; x < c; x += chunk_size) {
|
||||
unsigned current;
|
||||
for (unsigned int x = 0; x < c; x += chunk_size) {
|
||||
unsigned int current;
|
||||
current = c - x;
|
||||
if (current > chunk_size)
|
||||
current = chunk_size;
|
||||
@@ -3550,12 +3550,12 @@ COMMAND_HANDLER(handle_mw_command)
|
||||
uint64_t value;
|
||||
COMMAND_PARSE_NUMBER(u64, CMD_ARGV[1], value);
|
||||
|
||||
unsigned count = 1;
|
||||
unsigned int count = 1;
|
||||
if (CMD_ARGC == 3)
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[2], count);
|
||||
|
||||
struct target *target = get_current_target(CMD_CTX);
|
||||
unsigned wordsize;
|
||||
unsigned int wordsize;
|
||||
switch (CMD_NAME[2]) {
|
||||
case 'd':
|
||||
wordsize = 8;
|
||||
|
||||
Reference in New Issue
Block a user