Skip to content

Commit bcebc84

Browse files
zqb-allborneoa
authored andcommitted
contrib: convert 'unsigned' to 'unsigned int'
Conversion done with checkpatch --fix-inplace -types UNSPECIFIED_INT Change-Id: I0e31f87d437fcf3503736474f10a63f9c6be242b Signed-off-by: Mark Zhuang <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8368 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
1 parent 40d58ce commit bcebc84

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

contrib/itmdump.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ unsigned int dump_swit;
4343
* NOTE that this specific encoding could be space-optimized; and that
4444
* trace data streams could also be history-sensitive.
4545
*/
46-
static void show_task(int port, unsigned data)
46+
static void show_task(int port, unsigned int data)
4747
{
48-
unsigned code = data >> 16;
48+
unsigned int code = data >> 16;
4949
char buf[16];
5050

5151
if (dump_swit)
@@ -77,7 +77,7 @@ static void show_task(int port, unsigned data)
7777

7878
static void show_reserved(FILE *f, char *label, int c)
7979
{
80-
unsigned i;
80+
unsigned int i;
8181

8282
if (dump_swit)
8383
return;
@@ -96,9 +96,9 @@ static void show_reserved(FILE *f, char *label, int c)
9696
printf("\n");
9797
}
9898

99-
static bool read_varlen(FILE *f, int c, unsigned *value)
99+
static bool read_varlen(FILE *f, int c, unsigned int *value)
100100
{
101-
unsigned size;
101+
unsigned int size;
102102
unsigned char buf[4];
103103

104104
*value = 0;
@@ -135,8 +135,8 @@ static bool read_varlen(FILE *f, int c, unsigned *value)
135135

136136
static void show_hard(FILE *f, int c)
137137
{
138-
unsigned type = c >> 3;
139-
unsigned value;
138+
unsigned int type = c >> 3;
139+
unsigned int value;
140140
char *label;
141141

142142
if (dump_swit)
@@ -230,16 +230,16 @@ static void show_hard(FILE *f, int c)
230230
*/
231231
struct {
232232
int port;
233-
void (*show)(int port, unsigned data);
233+
void (*show)(int port, unsigned int data);
234234
} format[] = {
235235
{ .port = 31, .show = show_task, },
236236
};
237237

238238
static void show_swit(FILE *f, int c)
239239
{
240-
unsigned port = c >> 3;
241-
unsigned value = 0;
242-
unsigned i;
240+
unsigned int port = c >> 3;
241+
unsigned int value = 0;
242+
unsigned int i;
243243

244244
if (port + 1 == dump_swit) {
245245
if (!read_varlen(f, c, &value))
@@ -272,7 +272,7 @@ static void show_swit(FILE *f, int c)
272272

273273
static void show_timestamp(FILE *f, int c)
274274
{
275-
unsigned counter = 0;
275+
unsigned int counter = 0;
276276
char *label = "";
277277
bool delayed = false;
278278

contrib/loaders/flash/fespi/riscv_fespi.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void fespi_disable_hw_mode(volatile uint32_t *ctrl_base);
103103
static void fespi_enable_hw_mode(volatile uint32_t *ctrl_base);
104104
static int fespi_wip(volatile uint32_t *ctrl_base);
105105
static int fespi_write_buffer(volatile uint32_t *ctrl_base,
106-
const uint8_t *buffer, unsigned offset, unsigned len,
106+
const uint8_t *buffer, unsigned int offset, unsigned int len,
107107
uint32_t flash_info);
108108

109109
/* Can set bits 3:0 in result. */
@@ -113,7 +113,7 @@ static int fespi_write_buffer(volatile uint32_t *ctrl_base,
113113
* after pprog_cmd
114114
*/
115115
int flash_fespi(volatile uint32_t *ctrl_base, uint32_t page_size,
116-
const uint8_t *buffer, unsigned offset, uint32_t count,
116+
const uint8_t *buffer, unsigned int offset, uint32_t count,
117117
uint32_t flash_info)
118118
{
119119
int result;
@@ -163,12 +163,12 @@ int flash_fespi(volatile uint32_t *ctrl_base, uint32_t page_size,
163163
return result;
164164
}
165165

166-
static uint32_t fespi_read_reg(volatile uint32_t *ctrl_base, unsigned address)
166+
static uint32_t fespi_read_reg(volatile uint32_t *ctrl_base, unsigned int address)
167167
{
168168
return ctrl_base[address / 4];
169169
}
170170

171-
static void fespi_write_reg(volatile uint32_t *ctrl_base, unsigned address, uint32_t value)
171+
static void fespi_write_reg(volatile uint32_t *ctrl_base, unsigned int address, uint32_t value)
172172
{
173173
ctrl_base[address / 4] = value;
174174
}
@@ -188,7 +188,7 @@ static void fespi_enable_hw_mode(volatile uint32_t *ctrl_base)
188188
/* Can set bits 7:4 in result. */
189189
static int fespi_txwm_wait(volatile uint32_t *ctrl_base)
190190
{
191-
unsigned timeout = TIMEOUT;
191+
unsigned int timeout = TIMEOUT;
192192

193193
while (timeout--) {
194194
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)
209209
/* Can set bits 11:8 in result. */
210210
static int fespi_tx(volatile uint32_t *ctrl_base, uint8_t in)
211211
{
212-
unsigned timeout = TIMEOUT;
212+
unsigned int timeout = TIMEOUT;
213213

214214
while (timeout--) {
215215
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)
224224
/* Can set bits 15:12 in result. */
225225
static int fespi_rx(volatile uint32_t *ctrl_base, uint8_t *out)
226226
{
227-
unsigned timeout = TIMEOUT;
227+
unsigned int timeout = TIMEOUT;
228228

229229
while (timeout--) {
230230
uint32_t value = fespi_read_reg(ctrl_base, FESPI_REG_RXFIFO);
@@ -252,7 +252,7 @@ static int fespi_wip(volatile uint32_t *ctrl_base)
252252
if (result != ERROR_OK)
253253
return result | ERROR_STACK(0x20000);
254254

255-
unsigned timeout = TIMEOUT;
255+
unsigned int timeout = TIMEOUT;
256256
while (timeout--) {
257257
result = fespi_tx(ctrl_base, 0);
258258
if (result != ERROR_OK)
@@ -273,7 +273,7 @@ static int fespi_wip(volatile uint32_t *ctrl_base)
273273

274274
/* Can set bits 23:20 in result. */
275275
static int fespi_write_buffer(volatile uint32_t *ctrl_base,
276-
const uint8_t *buffer, unsigned offset, unsigned len,
276+
const uint8_t *buffer, unsigned int offset, unsigned int len,
277277
uint32_t flash_info)
278278
{
279279
int result = fespi_tx(ctrl_base, SPIFLASH_WRITE_ENABLE);
@@ -304,7 +304,7 @@ static int fespi_write_buffer(volatile uint32_t *ctrl_base,
304304
if (result != ERROR_OK)
305305
return result | ERROR_STACK(0x600000);
306306

307-
for (unsigned i = 0; i < len; i++) {
307+
for (unsigned int i = 0; i < len; i++) {
308308
result = fespi_tx(ctrl_base, buffer[i]);
309309
if (result != ERROR_OK)
310310
return result | ERROR_STACK(0x700000);

0 commit comments

Comments
 (0)