diff options
author | Andrea Grandi <agrandi@google.com> | 2022-12-28 14:29:27 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-01-04 00:03:02 +0000 |
commit | 9d53cabe56d5c33cb3169161f3f8438ab16f45fe (patch) | |
tree | db15307ead2a403895221ec320ab6215267d7c3d | |
parent | 9e599bc7f65ec16daeb82ccacf93b8574ce1db85 (diff) | |
download | chrome-ec-9d53cabe56d5c33cb3169161f3f8438ab16f45fe.tar.gz |
tree: Replace "unsigned" with "unsigned int"
Fix checkpatch error:
> Prefer 'unsigned int' to bare use of 'unsigned'
BUG=b:262047616
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
BRANCH=none
Change-Id: Ibf82332a1e1ea0a0a03d3993336e24883e495e05
Signed-off-by: Andrea Grandi <agrandi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4126483
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
40 files changed, 125 insertions, 121 deletions
diff --git a/board/elm/led.c b/board/elm/led.c index 09b5c55f51..211d1b2bbf 100644 --- a/board/elm/led.c +++ b/board/elm/led.c @@ -91,7 +91,7 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness) } } -static unsigned blink_second; +static unsigned int blink_second; static void elm_led_set_power(void) { diff --git a/board/zinger/runtime.c b/board/zinger/runtime.c index 19c33c7f0f..25d09d797c 100644 --- a/board/zinger/runtime.c +++ b/board/zinger/runtime.c @@ -36,9 +36,9 @@ void force_time(timestamp_t ts) STM32_TIM32_CNT(2) = ts.le.lo; } -void udelay(unsigned us) +void udelay(unsigned int us) { - unsigned t0 = STM32_TIM32_CNT(2); + unsigned int t0 = STM32_TIM32_CNT(2); while ((STM32_TIM32_CNT(2) - t0) < us) ; } @@ -289,6 +289,6 @@ void __hw_timer_enable_clock(int n, int enable) { /* Done in hardware init */ } -void usleep(unsigned us) +void usleep(unsigned int us) { /* Used only as a workaround */ } diff --git a/chip/ish/i2c.c b/chip/ish/i2c.c index 230f073369..1da65b0b15 100644 --- a/chip/ish/i2c.c +++ b/chip/ish/i2c.c @@ -253,7 +253,7 @@ static void i2c_write_buffer(uint32_t *base, uint8_t len, const uint8_t *buffer, } static void i2c_write_read_commands(uint32_t *base, uint8_t len, int more_data, - unsigned restart_flag) + unsigned int restart_flag) { /* this routine just set RX FIFO's control bit(s), * READ command or RESTART */ diff --git a/chip/max32660/i2c_chip.c b/chip/max32660/i2c_chip.c index a4fab91199..1e4dd3f365 100644 --- a/chip/max32660/i2c_chip.c +++ b/chip/max32660/i2c_chip.c @@ -132,7 +132,7 @@ struct i2c_req { uint8_t addr_match_flag; const uint8_t *tx_data; uint8_t *rx_data; - volatile unsigned received_count; + volatile unsigned int received_count; volatile int tx_remain; volatile i2c_target_state_t state; volatile int restart; diff --git a/chip/mchp/dma.c b/chip/mchp/dma.c index c921527d7f..180735dbb5 100644 --- a/chip/mchp/dma.c +++ b/chip/mchp/dma.c @@ -106,7 +106,7 @@ void dma_go_chan(enum dma_channel ch) MCHP_DMA_CH_CTRL(ch) |= MCHP_DMA_RUN; } -void dma_prepare_tx(const struct dma_option *option, unsigned count, +void dma_prepare_tx(const struct dma_option *option, unsigned int count, const void *memory) { if (option != NULL) @@ -139,7 +139,8 @@ void dma_xfr_prepare_tx(const struct dma_option *option, uint32_t count, } } -void dma_start_rx(const struct dma_option *option, unsigned count, void *memory) +void dma_start_rx(const struct dma_option *option, unsigned int count, + void *memory) { if (option != NULL) { prepare_channel(option->channel, count, option->periph, memory, diff --git a/chip/stm32/dma-stm32f4.c b/chip/stm32/dma-stm32f4.c index 3121089437..15fb0f28ef 100644 --- a/chip/stm32/dma-stm32f4.c +++ b/chip/stm32/dma-stm32f4.c @@ -90,8 +90,8 @@ void dma_disable_all(void) * @param memory Pointer to memory address for receive/transmit * @param flags DMA flags for the control register. */ -static void prepare_stream(enum dma_channel stream, unsigned count, - void *periph, void *memory, unsigned flags) +static void prepare_stream(enum dma_channel stream, unsigned int count, + void *periph, void *memory, unsigned int flags) { stm32_dma_stream_t *dma_stream = dma_get_channel(stream); uint32_t ccr = STM32_DMA_CCR_PL_VERY_HIGH; @@ -120,7 +120,7 @@ void dma_go(stm32_dma_stream_t *stream) stream->scr |= STM32_DMA_CCR_EN; } -void dma_prepare_tx(const struct dma_option *option, unsigned count, +void dma_prepare_tx(const struct dma_option *option, unsigned int count, const void *memory) { /* @@ -132,7 +132,8 @@ void dma_prepare_tx(const struct dma_option *option, unsigned count, option->flags); } -void dma_start_rx(const struct dma_option *option, unsigned count, void *memory) +void dma_start_rx(const struct dma_option *option, unsigned int count, + void *memory) { stm32_dma_stream_t *stream = dma_get_channel(option->channel); @@ -203,7 +204,7 @@ void dma_test(enum dma_channel stream) stm32_dma_stream_t *dma_stream = dma_get_channel(stream); uint32_t ctrl; char periph[32], memory[32]; - unsigned count = sizeof(periph); + unsigned int count = sizeof(periph); int i; memset(memory, '\0', sizeof(memory)); diff --git a/chip/stm32/pwm.c b/chip/stm32/pwm.c index a9f266cbe0..bf32793c64 100644 --- a/chip/stm32/pwm.c +++ b/chip/stm32/pwm.c @@ -40,7 +40,7 @@ static void pwm_configure(enum pwm_channel ch) { const struct pwm_t *pwm = pwm_channels + ch; timer_ctlr_t *tim = (timer_ctlr_t *)(pwm->tim.base); - volatile unsigned *ccmr = NULL; + volatile unsigned int *ccmr = NULL; /* Default frequency = 100 Hz */ int frequency = pwm->frequency ? pwm->frequency : 100; uint16_t ccer; diff --git a/chip/stm32/registers-stm32f0.h b/chip/stm32/registers-stm32f0.h index 645ed5048e..6d1907e48a 100644 --- a/chip/stm32/registers-stm32f0.h +++ b/chip/stm32/registers-stm32f0.h @@ -428,15 +428,15 @@ struct stm32_spi_regs { uint16_t _pad0; uint16_t cr2; uint16_t _pad1; - unsigned sr; + unsigned int sr; uint8_t dr; uint8_t _pad2; uint16_t _pad3; - unsigned crcpr; - unsigned rxcrcr; - unsigned txcrcr; - unsigned i2scfgr; /* STM32L only */ - unsigned i2spr; /* STM32L only */ + unsigned int crcpr; + unsigned int rxcrcr; + unsigned int txcrcr; + unsigned int i2scfgr; /* STM32L only */ + unsigned int i2spr; /* STM32L only */ }; /* Must be volatile, or compiler optimizes out repeated accesses */ typedef volatile struct stm32_spi_regs stm32_spi_regs_t; diff --git a/chip/stm32/registers-stm32f3.h b/chip/stm32/registers-stm32f3.h index e88f5f7d52..82880accdc 100644 --- a/chip/stm32/registers-stm32f3.h +++ b/chip/stm32/registers-stm32f3.h @@ -489,15 +489,15 @@ struct stm32_spi_regs { uint16_t _pad0; uint16_t cr2; uint16_t _pad1; - unsigned sr; + unsigned int sr; uint8_t dr; uint8_t _pad2; uint16_t _pad3; - unsigned crcpr; - unsigned rxcrcr; - unsigned txcrcr; - unsigned i2scfgr; /* STM32L only */ - unsigned i2spr; /* STM32L only */ + unsigned int crcpr; + unsigned int rxcrcr; + unsigned int txcrcr; + unsigned int i2scfgr; /* STM32L only */ + unsigned int i2spr; /* STM32L only */ }; /* Must be volatile, or compiler optimizes out repeated accesses */ typedef volatile struct stm32_spi_regs stm32_spi_regs_t; diff --git a/chip/stm32/registers-stm32f4.h b/chip/stm32/registers-stm32f4.h index a415b80d5c..5db9b5b9e6 100644 --- a/chip/stm32/registers-stm32f4.h +++ b/chip/stm32/registers-stm32f4.h @@ -656,15 +656,15 @@ struct stm32_spi_regs { uint16_t _pad0; uint16_t cr2; uint16_t _pad1; - unsigned sr; + unsigned int sr; uint8_t dr; uint8_t _pad2; uint16_t _pad3; - unsigned crcpr; - unsigned rxcrcr; - unsigned txcrcr; - unsigned i2scfgr; /* STM32L only */ - unsigned i2spr; /* STM32L only */ + unsigned int crcpr; + unsigned int rxcrcr; + unsigned int txcrcr; + unsigned int i2scfgr; /* STM32L only */ + unsigned int i2spr; /* STM32L only */ }; /* Must be volatile, or compiler optimizes out repeated accesses */ typedef volatile struct stm32_spi_regs stm32_spi_regs_t; diff --git a/chip/stm32/registers-stm32f7.h b/chip/stm32/registers-stm32f7.h index a597cbfe68..37c89bbe07 100644 --- a/chip/stm32/registers-stm32f7.h +++ b/chip/stm32/registers-stm32f7.h @@ -587,15 +587,15 @@ struct stm32_spi_regs { uint16_t _pad0; uint16_t cr2; uint16_t _pad1; - unsigned sr; + unsigned int sr; uint8_t dr; uint8_t _pad2; uint16_t _pad3; - unsigned crcpr; - unsigned rxcrcr; - unsigned txcrcr; - unsigned i2scfgr; /* STM32L only */ - unsigned i2spr; /* STM32L only */ + unsigned int crcpr; + unsigned int rxcrcr; + unsigned int txcrcr; + unsigned int i2scfgr; /* STM32L only */ + unsigned int i2spr; /* STM32L only */ }; /* Must be volatile, or compiler optimizes out repeated accesses */ typedef volatile struct stm32_spi_regs stm32_spi_regs_t; diff --git a/chip/stm32/registers-stm32g4.h b/chip/stm32/registers-stm32g4.h index 4610bb1e98..a19aa942b0 100644 --- a/chip/stm32/registers-stm32g4.h +++ b/chip/stm32/registers-stm32g4.h @@ -833,7 +833,7 @@ struct stm32_spi_regs { uint16_t _pad0; uint16_t cr2; uint16_t _pad1; - unsigned sr; + unsigned int sr; uint8_t dr; uint8_t _pad2; uint16_t _pad3; diff --git a/chip/stm32/registers-stm32l.h b/chip/stm32/registers-stm32l.h index 07ead4411a..57302a9d8d 100644 --- a/chip/stm32/registers-stm32l.h +++ b/chip/stm32/registers-stm32l.h @@ -416,15 +416,15 @@ struct stm32_spi_regs { uint16_t _pad0; uint16_t cr2; uint16_t _pad1; - unsigned sr; + unsigned int sr; uint8_t dr; uint8_t _pad2; uint16_t _pad3; - unsigned crcpr; - unsigned rxcrcr; - unsigned txcrcr; - unsigned i2scfgr; /* STM32L only */ - unsigned i2spr; /* STM32L only */ + unsigned int crcpr; + unsigned int rxcrcr; + unsigned int txcrcr; + unsigned int i2scfgr; /* STM32L only */ + unsigned int i2spr; /* STM32L only */ }; /* Must be volatile, or compiler optimizes out repeated accesses */ typedef volatile struct stm32_spi_regs stm32_spi_regs_t; diff --git a/chip/stm32/registers.h b/chip/stm32/registers.h index 2ec0ff28fc..c4441315af 100644 --- a/chip/stm32/registers.h +++ b/chip/stm32/registers.h @@ -113,28 +113,28 @@ #define STM32_TIM32_CCR4(n) STM32_TIM_REG32(n, 0x40) /* Timer registers as struct */ struct timer_ctlr { - unsigned cr1; - unsigned cr2; - unsigned smcr; - unsigned dier; + unsigned int cr1; + unsigned int cr2; + unsigned int smcr; + unsigned int dier; - unsigned sr; - unsigned egr; - unsigned ccmr1; - unsigned ccmr2; + unsigned int sr; + unsigned int egr; + unsigned int ccmr1; + unsigned int ccmr2; - unsigned ccer; - unsigned cnt; - unsigned psc; - unsigned arr; + unsigned int ccer; + unsigned int cnt; + unsigned int psc; + unsigned int arr; - unsigned ccr[5]; /* ccr[0] = reserved30 */ + unsigned int ccr[5]; /* ccr[0] = reserved30 */ - unsigned bdtr; - unsigned dcr; - unsigned dmar; + unsigned int bdtr; + unsigned int dcr; + unsigned int dmar; - unsigned option_register; + unsigned int option_register; }; /* Must be volatile, or compiler optimizes out repeated accesses */ typedef volatile struct timer_ctlr timer_ctlr_t; diff --git a/common/crc8.c b/common/crc8.c index 0aba3e80a3..5d8df8db52 100644 --- a/common/crc8.c +++ b/common/crc8.c @@ -12,7 +12,7 @@ inline uint8_t cros_crc8(const uint8_t *data, int len) uint8_t cros_crc8_arg(const uint8_t *data, int len, uint8_t previous_crc) { - unsigned crc = previous_crc << 8; + unsigned int crc = previous_crc << 8; int i, j; for (j = len; j; j--, data++) { diff --git a/common/i2c_wedge.c b/common/i2c_wedge.c index ff8c5d494f..23e3f6ceae 100644 --- a/common/i2c_wedge.c +++ b/common/i2c_wedge.c @@ -137,7 +137,7 @@ static int i2c_bang_in_bit(void) /* Write a byte to I2C bus. Return 0 if ack by the peripheral. */ static int i2c_bang_out_byte(int send_start, int send_stop, unsigned char byte) { - unsigned bit; + unsigned int bit; int nack; int tmp = byte; diff --git a/common/memory_commands.c b/common/memory_commands.c index cb53c4890a..163460a2d1 100644 --- a/common/memory_commands.c +++ b/common/memory_commands.c @@ -116,8 +116,8 @@ static int command_read_word(int argc, const char **argv) { volatile uint32_t *address; uint32_t value; - unsigned access_size = 4; - unsigned argc_offs = 0; + unsigned int access_size = 4; + unsigned int argc_offs = 0; char *e; if (argc < 2) diff --git a/common/power_button_x86.c b/common/power_button_x86.c index efa51530e5..57049a71af 100644 --- a/common/power_button_x86.c +++ b/common/power_button_x86.c @@ -425,14 +425,15 @@ void power_button_task(void *u) tsleep = tnext_state; t = get_time().val; if (tsleep > t) { - unsigned d = tsleep == -1 ? -1 : (unsigned)(tsleep - t); + unsigned int d = + tsleep == -1 ? -1 : (unsigned int)(tsleep - t); /* - * (Yes, the conversion from uint64_t to unsigned could - * theoretically overflow if we wanted to sleep for - * more than 2^32 us, but our timeouts are small enough - * that can't happen - and even if it did, we'd just go - * back to sleep after deciding that we woke up too - * early.) + * (Yes, the conversion from uint64_t to unsigned int + * could theoretically overflow if we wanted to sleep + * for more than 2^32 us, but our timeouts are small + * enough that can't happen - and even if it did, we'd + * just go back to sleep after deciding that we woke up + * too early.) */ CPRINTS("PB task %d = %s, wait %d", pwrbtn_state, state_names[pwrbtn_state], d); diff --git a/common/timer.c b/common/timer.c index bf2a731a1d..9d45e4faf3 100644 --- a/common/timer.c +++ b/common/timer.c @@ -115,9 +115,9 @@ int timestamp_expired(timestamp_t deadline, const timestamp_t *now) } #ifndef CONFIG_HW_SPECIFIC_UDELAY -void udelay(unsigned us) +void udelay(unsigned int us) { - unsigned t0 = __hw_clock_source_read(); + unsigned int t0 = __hw_clock_source_read(); /* * udelay() may be called with interrupts disabled, so we can't rely on @@ -174,7 +174,7 @@ void timer_cancel(task_id_t tskid) * probability of delay longer than 2*us (and possibly infinite delay) * increases. */ -void usleep(unsigned us) +void usleep(unsigned int us) { uint32_t evt = 0; uint32_t t0; diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index 03e069df8c..70efe04507 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -159,7 +159,7 @@ static uint32_t task_reset_state[TASK_ID_COUNT] = { #endif /* CONFIG_TASK_RESET_LIST */ /* Validity checks about static task invariants */ -BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned) * 8); +BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned int) * 8); BUILD_ASSERT(TASK_ID_COUNT < (1 << (sizeof(task_id_t) * 8))); BUILD_ASSERT(BIT(TASK_ID_COUNT) < TASK_RESET_LOCK); diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index 03490025b5..b6f0884465 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -107,7 +107,7 @@ static const struct { /* Contexts for all tasks */ static task_ tasks[TASK_ID_COUNT]; /* Validity checks about static task invariants */ -BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned) * 8); +BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned int) * 8); BUILD_ASSERT(TASK_ID_COUNT < (1 << (sizeof(task_id_t) * 8))); /* Stacks for all tasks */ diff --git a/core/host/task.c b/core/host/task.c index fa853dce60..36996784af 100644 --- a/core/host/task.c +++ b/core/host/task.c @@ -185,7 +185,7 @@ void task_trigger_test_interrupt(void (*isr)(void)) pthread_mutex_unlock(&interrupt_lock); } -void interrupt_generator_udelay(unsigned us) +void interrupt_generator_udelay(unsigned int us) { generator_sleep_deadline.val = get_time().val + us; generator_sleeping = 1; diff --git a/core/host/timer.c b/core/host/timer.c index b2c9c5c478..03c1f70018 100644 --- a/core/host/timer.c +++ b/core/host/timer.c @@ -17,7 +17,7 @@ static timestamp_t boot_time; static int time_set; -void usleep(unsigned us) +void usleep(unsigned int us) { if (!task_start_called() || task_get_current() == TASK_ID_INVALID) { udelay(us); @@ -63,7 +63,7 @@ void force_time(timestamp_t ts) time_set = 1; } -void udelay(unsigned us) +void udelay(unsigned int us) { timestamp_t deadline; diff --git a/core/minute-ia/interrupts.c b/core/minute-ia/interrupts.c index 34baa68fa8..b99bb6e49a 100644 --- a/core/minute-ia/interrupts.c +++ b/core/minute-ia/interrupts.c @@ -444,10 +444,11 @@ void lapic_restore(void) void init_interrupts(void) { - unsigned entry; + unsigned int entry; const struct irq_def *p; - unsigned num_system_irqs = ARRAY_SIZE(system_irqs); - unsigned max_entries = (read_ioapic_reg(IOAPIC_VERSION) >> 16) & 0xff; + unsigned int num_system_irqs = ARRAY_SIZE(system_irqs); + unsigned int max_entries = (read_ioapic_reg(IOAPIC_VERSION) >> 16) & + 0xff; /* Setup gates for IRQs declared by drivers using DECLARE_IRQ */ for (p = __irq_data; p < __irq_data_end; p++) diff --git a/core/minute-ia/interrupts.h b/core/minute-ia/interrupts.h index 65b26c437e..34abd587d3 100644 --- a/core/minute-ia/interrupts.h +++ b/core/minute-ia/interrupts.h @@ -13,10 +13,10 @@ #define USHRT_MAX 0xFFFF typedef struct { - unsigned irq; - unsigned trigger; - unsigned polarity; - unsigned vector; + unsigned int irq; + unsigned int trigger; + unsigned int polarity; + unsigned int vector; } irq_desc_t; #define INTR_DESC(__irq, __vector, __trig) \ diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c index 540e387d2a..524314815c 100644 --- a/core/minute-ia/task.c +++ b/core/minute-ia/task.c @@ -116,7 +116,7 @@ static const struct { /* Contexts for all tasks */ static task_ tasks[TASK_ID_COUNT]; /* Validity checks about static task invariants */ -BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned) * 8); +BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned int) * 8); BUILD_ASSERT(TASK_ID_COUNT < (1 << (sizeof(task_id_t) * 8))); /* Stacks for all tasks */ diff --git a/core/nds32/task.c b/core/nds32/task.c index 427f0e1202..964c9c9d73 100644 --- a/core/nds32/task.c +++ b/core/nds32/task.c @@ -117,7 +117,7 @@ static const struct { /* Contexts for all tasks */ static task_ tasks[TASK_ID_COUNT]; /* Validity checks about static task invariants */ -BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned) * 8); +BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned int) * 8); BUILD_ASSERT(TASK_ID_COUNT < (1 << (sizeof(task_id_t) * 8))); /* Stacks for all tasks */ diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c index fd0d3938cb..f23ebc2ce4 100644 --- a/core/riscv-rv32i/task.c +++ b/core/riscv-rv32i/task.c @@ -113,7 +113,7 @@ static const struct { /* Contexts for all tasks */ static task_ tasks[TASK_ID_COUNT] __attribute__((section(".bss.tasks"))); /* Validity checks about static task invariants */ -BUILD_ASSERT(TASK_ID_COUNT <= (sizeof(unsigned) * 8)); +BUILD_ASSERT(TASK_ID_COUNT <= (sizeof(unsigned int) * 8)); BUILD_ASSERT(TASK_ID_COUNT < (1 << (sizeof(task_id_t) * 8))); /* Stacks for all tasks */ diff --git a/driver/touchpad_st.h b/driver/touchpad_st.h index 1dee7f0947..ec3fe0686b 100644 --- a/driver/touchpad_st.h +++ b/driver/touchpad_st.h @@ -190,8 +190,8 @@ struct st_tp_host_buffer_heat_map_t { struct st_tp_event_t { #define ST_TP_EVENT_MAGIC 0x3 - unsigned magic : 2; /* should always be 0x3 */ - unsigned major_high : 2; + unsigned int magic : 2; /* should always be 0x3 */ + unsigned int major_high : 2; #define ST_TP_EVENT_ID_CONTROLLER_READY 0x0 #define ST_TP_EVENT_ID_ENTER_POINTER 0x1 #define ST_TP_EVENT_ID_MOTION_POINTER 0x2 @@ -200,7 +200,7 @@ struct st_tp_event_t { #define ST_TP_EVENT_ID_USER_REPORT 0x5 #define ST_TP_EVENT_ID_DEBUG_REPORT 0xe #define ST_TP_EVENT_ID_ERROR_REPORT 0xf - unsigned evt_id : 4; + unsigned int evt_id : 4; union { struct { @@ -209,10 +209,10 @@ struct st_tp_event_t { #define ST_TP_TOUCH_TYPE_GLOVE 0x2 #define ST_TP_TOUCH_TYPE_STYLUS 0x3 #define ST_TP_TOUCH_TYPE_PALM 0x4 - unsigned touch_type : 4; - unsigned touch_id : 4; - unsigned y : 12; - unsigned x : 12; + unsigned int touch_type : 4; + unsigned int touch_id : 4; + unsigned int y : 12; + unsigned int x : 12; uint8_t z; uint8_t minor : 4; // need to be concat with minor_high uint8_t major : 4; // need to be concat with major_high @@ -229,9 +229,9 @@ struct st_tp_event_t { } __packed report; } __packed; /* anonymous */ - unsigned minor_high : 2; - unsigned reserved : 1; - unsigned evt_left : 5; + unsigned int minor_high : 2; + unsigned int reserved : 1; + unsigned int evt_left : 5; } __packed; struct st_tp_fw_header_t { diff --git a/include/dma.h b/include/dma.h index f35826a132..e97350f530 100644 --- a/include/dma.h +++ b/include/dma.h @@ -19,7 +19,7 @@ struct dma_option { enum dma_channel channel; /* DMA channel */ void *periph; /* Pointer to peripheral data register */ - unsigned flags; /* DMA flags for the control register. Normally + unsigned int flags; /* DMA flags for the control register. Normally used to select memory size. */ }; @@ -45,7 +45,7 @@ dma_chan_t *dma_get_channel(enum dma_channel channel); * * @return pointer to prepared channel */ -void dma_prepare_tx(const struct dma_option *option, unsigned count, +void dma_prepare_tx(const struct dma_option *option, unsigned int count, const void *memory); /** @@ -55,7 +55,7 @@ void dma_prepare_tx(const struct dma_option *option, unsigned count, * @param count Number of bytes to transfer * @param memory Pointer to memory address */ -void dma_start_rx(const struct dma_option *option, unsigned count, +void dma_start_rx(const struct dma_option *option, unsigned int count, void *memory); /** diff --git a/include/lightbar.h b/include/lightbar.h index aff5e6fc68..e86701cac2 100644 --- a/include/lightbar.h +++ b/include/lightbar.h @@ -38,7 +38,7 @@ struct lb_brightness_def { }; extern const struct lb_brightness_def lb_brightness_levels[]; -extern const unsigned lb_brightness_levels_count; +extern const unsigned int lb_brightness_levels_count; #endif /* Request a preset sequence from the lightbar task. */ diff --git a/include/motion_sense.h b/include/motion_sense.h index ac074055aa..b3a7d019ee 100644 --- a/include/motion_sense.h +++ b/include/motion_sense.h @@ -251,9 +251,9 @@ extern mutex_t g_sensor_mutex; extern struct motion_sensor_t motion_sensors[]; #ifdef CONFIG_DYNAMIC_MOTION_SENSOR_COUNT -extern unsigned motion_sensor_count; +extern unsigned int motion_sensor_count; #else -extern const unsigned motion_sensor_count; +extern const unsigned int motion_sensor_count; #endif /* Needed if reading ALS via LPC is needed */ extern const struct motion_sensor_t *motion_als_sensors[]; diff --git a/include/test_util.h b/include/test_util.h index 48560cd938..2a37632ae3 100644 --- a/include/test_util.h +++ b/include/test_util.h @@ -198,7 +198,7 @@ void task_trigger_test_interrupt(void (*isr)(void)); * to udelay() from interrupt generator are delegated to this function * automatically. */ -void interrupt_generator_udelay(unsigned us); +void interrupt_generator_udelay(unsigned int us); #ifdef EMU_BUILD void wait_for_task_started(void); diff --git a/include/timer.h b/include/timer.h index 7170a35056..a68ce959b2 100644 --- a/include/timer.h +++ b/include/timer.h @@ -76,7 +76,7 @@ int timestamp_expired(timestamp_t deadline, const timestamp_t *now); * * @param us Number of microseconds to delay. */ -void udelay(unsigned us); +void udelay(unsigned int us); /** * Sleep. @@ -89,7 +89,7 @@ void udelay(unsigned us); * * @param us Number of microseconds to sleep. */ -void usleep(unsigned us); +void usleep(unsigned int us); /** * Sleep for milliseconds. @@ -98,7 +98,7 @@ void usleep(unsigned us); * * @param ms Number of milliseconds to sleep. */ -static inline void msleep(unsigned ms) +static inline void msleep(unsigned int ms) { usleep(ms * MSEC); } @@ -110,7 +110,7 @@ static inline void msleep(unsigned ms) * * @param sec Number of seconds to sleep. */ -static inline void sleep(unsigned sec) +static inline void sleep(unsigned int sec) { usleep(sec * SECOND); } @@ -166,7 +166,7 @@ static inline int time_until(uint32_t from_time, uint32_t to_time) * @param start Start time to compare against * @return number of microseconds that have elapsed since that start time */ -static inline unsigned time_since32(timestamp_t start) +static inline unsigned int time_since32(timestamp_t start) { return time_until(start.le.lo, get_time().le.lo); } diff --git a/include/usb_pd.h b/include/usb_pd.h index ea8675318d..956fd3793d 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1565,13 +1565,13 @@ void pd_snk_give_back(int port, uint32_t *const ma, uint32_t *const mv); * Put a cap on the max voltage requested as a sink. * @param mv maximum voltage in millivolts. */ -void pd_set_max_voltage(unsigned mv); +void pd_set_max_voltage(unsigned int mv); /** * Get the max voltage that can be requested as set by pd_set_max_voltage(). * @return max voltage */ -unsigned pd_get_max_voltage(void); +unsigned int pd_get_max_voltage(void); /** * Check if this board supports the given input voltage. diff --git a/test/timer_calib.c b/test/timer_calib.c index 9a58237e2f..115bbc4841 100644 --- a/test/timer_calib.c +++ b/test/timer_calib.c @@ -19,7 +19,7 @@ uint32_t difftime(timestamp_t t0, timestamp_t t1) int timer_calib_task(void *data) { timestamp_t t0, t1; - unsigned d; + unsigned int d; while (1) { task_wait_event(-1); diff --git a/util/ecst.c b/util/ecst.c index 2c3150c34a..5acb235c31 100644 --- a/util/ecst.c +++ b/util/ecst.c @@ -2167,7 +2167,7 @@ unsigned int calc_api_csum_bin(void) ******************************************************************* * * static int crc_tab...init - * static unsigned ... crc_tab...[] + * static unsigned int ... crc_tab...[] * * The algorithms use tables with pre-calculated values. This * speeds up the calculation dramatically. The first time the diff --git a/util/ectool.cc b/util/ectool.cc index 76e617e3ba..3414f93e20 100644 --- a/util/ectool.cc +++ b/util/ectool.cc @@ -9959,7 +9959,7 @@ int cmd_pd_log(int argc, char *argv[]) struct ec_response_usb_pd_power_info pinfo; int rv; unsigned long long milliseconds; - unsigned seconds; + unsigned int seconds; time_t now; struct tm ltime; char time_str[64]; diff --git a/zephyr/shim/src/hwtimer.c b/zephyr/shim/src/hwtimer.c index cefbe4eb7f..09082b05f1 100644 --- a/zephyr/shim/src/hwtimer.c +++ b/zephyr/shim/src/hwtimer.c @@ -23,7 +23,7 @@ uint32_t __hw_clock_event_get(void) return 0; } -void udelay(unsigned us) +void udelay(unsigned int us) { k_busy_wait(us); } diff --git a/zephyr/subsys/ap_pwrseq/signal_gpio.c b/zephyr/subsys/ap_pwrseq/signal_gpio.c index b3965fcc42..b47f1afd3d 100644 --- a/zephyr/subsys/ap_pwrseq/signal_gpio.c +++ b/zephyr/subsys/ap_pwrseq/signal_gpio.c @@ -23,8 +23,8 @@ const static struct gpio_dt_spec spec[] = { DT_INST_FOREACH_STATUS_OKAY( struct ps_gpio_int { gpio_flags_t flags; uint8_t signal; - unsigned output : 1; - unsigned no_enable : 1; + unsigned int output : 1; + unsigned int no_enable : 1; }; #define INIT_GPIO_CONFIG(inst) \ |