contrib: convert 'unsigned' to 'unsigned int'

Conversion done with
        checkpatch --fix-inplace -types UNSPECIFIED_INT

Change-Id: I0e31f87d437fcf3503736474f10a63f9c6be242b
Signed-off-by: Mark Zhuang <mark.zhuang@spacemit.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8368
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
Mark Zhuang 2024-10-26 10:30:18 +08:00 committed by Antonio Borneo
parent 40d58ce529
commit bcebc84882
2 changed files with 22 additions and 22 deletions

View File

@ -43,9 +43,9 @@ unsigned int dump_swit;
* NOTE that this specific encoding could be space-optimized; and that * NOTE that this specific encoding could be space-optimized; and that
* trace data streams could also be history-sensitive. * trace data streams could also be history-sensitive.
*/ */
static void show_task(int port, unsigned data) static void show_task(int port, unsigned int data)
{ {
unsigned code = data >> 16; unsigned int code = data >> 16;
char buf[16]; char buf[16];
if (dump_swit) if (dump_swit)
@ -77,7 +77,7 @@ static void show_task(int port, unsigned data)
static void show_reserved(FILE *f, char *label, int c) static void show_reserved(FILE *f, char *label, int c)
{ {
unsigned i; unsigned int i;
if (dump_swit) if (dump_swit)
return; return;
@ -96,9 +96,9 @@ static void show_reserved(FILE *f, char *label, int c)
printf("\n"); printf("\n");
} }
static bool read_varlen(FILE *f, int c, unsigned *value) static bool read_varlen(FILE *f, int c, unsigned int *value)
{ {
unsigned size; unsigned int size;
unsigned char buf[4]; unsigned char buf[4];
*value = 0; *value = 0;
@ -135,8 +135,8 @@ err:
static void show_hard(FILE *f, int c) static void show_hard(FILE *f, int c)
{ {
unsigned type = c >> 3; unsigned int type = c >> 3;
unsigned value; unsigned int value;
char *label; char *label;
if (dump_swit) if (dump_swit)
@ -230,16 +230,16 @@ static void show_hard(FILE *f, int c)
*/ */
struct { struct {
int port; int port;
void (*show)(int port, unsigned data); void (*show)(int port, unsigned int data);
} format[] = { } format[] = {
{ .port = 31, .show = show_task, }, { .port = 31, .show = show_task, },
}; };
static void show_swit(FILE *f, int c) static void show_swit(FILE *f, int c)
{ {
unsigned port = c >> 3; unsigned int port = c >> 3;
unsigned value = 0; unsigned int value = 0;
unsigned i; unsigned int i;
if (port + 1 == dump_swit) { if (port + 1 == dump_swit) {
if (!read_varlen(f, c, &value)) if (!read_varlen(f, c, &value))
@ -272,7 +272,7 @@ static void show_swit(FILE *f, int c)
static void show_timestamp(FILE *f, int c) static void show_timestamp(FILE *f, int c)
{ {
unsigned counter = 0; unsigned int counter = 0;
char *label = ""; char *label = "";
bool delayed = false; bool delayed = false;

View File

@ -103,7 +103,7 @@ static void fespi_disable_hw_mode(volatile uint32_t *ctrl_base);
static void fespi_enable_hw_mode(volatile uint32_t *ctrl_base); static void fespi_enable_hw_mode(volatile uint32_t *ctrl_base);
static int fespi_wip(volatile uint32_t *ctrl_base); static int fespi_wip(volatile uint32_t *ctrl_base);
static int fespi_write_buffer(volatile uint32_t *ctrl_base, static int fespi_write_buffer(volatile uint32_t *ctrl_base,
const uint8_t *buffer, unsigned offset, unsigned len, const uint8_t *buffer, unsigned int offset, unsigned int len,
uint32_t flash_info); uint32_t flash_info);
/* Can set bits 3:0 in result. */ /* Can set bits 3:0 in result. */
@ -113,7 +113,7 @@ static int fespi_write_buffer(volatile uint32_t *ctrl_base,
* after pprog_cmd * after pprog_cmd
*/ */
int flash_fespi(volatile uint32_t *ctrl_base, uint32_t page_size, int flash_fespi(volatile uint32_t *ctrl_base, uint32_t page_size,
const uint8_t *buffer, unsigned offset, uint32_t count, const uint8_t *buffer, unsigned int offset, uint32_t count,
uint32_t flash_info) uint32_t flash_info)
{ {
int result; int result;
@ -163,12 +163,12 @@ err:
return result; return result;
} }
static uint32_t fespi_read_reg(volatile uint32_t *ctrl_base, unsigned address) static uint32_t fespi_read_reg(volatile uint32_t *ctrl_base, unsigned int address)
{ {
return ctrl_base[address / 4]; return ctrl_base[address / 4];
} }
static void fespi_write_reg(volatile uint32_t *ctrl_base, unsigned address, uint32_t value) static void fespi_write_reg(volatile uint32_t *ctrl_base, unsigned int address, uint32_t value)
{ {
ctrl_base[address / 4] = value; ctrl_base[address / 4] = value;
} }
@ -188,7 +188,7 @@ static void fespi_enable_hw_mode(volatile uint32_t *ctrl_base)
/* Can set bits 7:4 in result. */ /* Can set bits 7:4 in result. */
static int fespi_txwm_wait(volatile uint32_t *ctrl_base) static int fespi_txwm_wait(volatile uint32_t *ctrl_base)
{ {
unsigned timeout = TIMEOUT; unsigned int timeout = TIMEOUT;
while (timeout--) { while (timeout--) {
uint32_t ip = fespi_read_reg(ctrl_base, FESPI_REG_IP); uint32_t ip = fespi_read_reg(ctrl_base, FESPI_REG_IP);
@ -209,7 +209,7 @@ static void fespi_set_dir(volatile uint32_t *ctrl_base, bool dir)
/* Can set bits 11:8 in result. */ /* Can set bits 11:8 in result. */
static int fespi_tx(volatile uint32_t *ctrl_base, uint8_t in) static int fespi_tx(volatile uint32_t *ctrl_base, uint8_t in)
{ {
unsigned timeout = TIMEOUT; unsigned int timeout = TIMEOUT;
while (timeout--) { while (timeout--) {
uint32_t txfifo = fespi_read_reg(ctrl_base, FESPI_REG_TXFIFO); uint32_t txfifo = fespi_read_reg(ctrl_base, FESPI_REG_TXFIFO);
@ -224,7 +224,7 @@ static int fespi_tx(volatile uint32_t *ctrl_base, uint8_t in)
/* Can set bits 15:12 in result. */ /* Can set bits 15:12 in result. */
static int fespi_rx(volatile uint32_t *ctrl_base, uint8_t *out) static int fespi_rx(volatile uint32_t *ctrl_base, uint8_t *out)
{ {
unsigned timeout = TIMEOUT; unsigned int timeout = TIMEOUT;
while (timeout--) { while (timeout--) {
uint32_t value = fespi_read_reg(ctrl_base, FESPI_REG_RXFIFO); uint32_t value = fespi_read_reg(ctrl_base, FESPI_REG_RXFIFO);
@ -252,7 +252,7 @@ static int fespi_wip(volatile uint32_t *ctrl_base)
if (result != ERROR_OK) if (result != ERROR_OK)
return result | ERROR_STACK(0x20000); return result | ERROR_STACK(0x20000);
unsigned timeout = TIMEOUT; unsigned int timeout = TIMEOUT;
while (timeout--) { while (timeout--) {
result = fespi_tx(ctrl_base, 0); result = fespi_tx(ctrl_base, 0);
if (result != ERROR_OK) if (result != ERROR_OK)
@ -273,7 +273,7 @@ static int fespi_wip(volatile uint32_t *ctrl_base)
/* Can set bits 23:20 in result. */ /* Can set bits 23:20 in result. */
static int fespi_write_buffer(volatile uint32_t *ctrl_base, static int fespi_write_buffer(volatile uint32_t *ctrl_base,
const uint8_t *buffer, unsigned offset, unsigned len, const uint8_t *buffer, unsigned int offset, unsigned int len,
uint32_t flash_info) uint32_t flash_info)
{ {
int result = fespi_tx(ctrl_base, SPIFLASH_WRITE_ENABLE); int result = fespi_tx(ctrl_base, SPIFLASH_WRITE_ENABLE);
@ -304,7 +304,7 @@ static int fespi_write_buffer(volatile uint32_t *ctrl_base,
if (result != ERROR_OK) if (result != ERROR_OK)
return result | ERROR_STACK(0x600000); return result | ERROR_STACK(0x600000);
for (unsigned i = 0; i < len; i++) { for (unsigned int i = 0; i < len; i++) {
result = fespi_tx(ctrl_base, buffer[i]); result = fespi_tx(ctrl_base, buffer[i]);
if (result != ERROR_OK) if (result != ERROR_OK)
return result | ERROR_STACK(0x700000); return result | ERROR_STACK(0x700000);