all: Add 'U' suffix when using unsigned variables

Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
This commit is contained in:
Patrik Flykt 2019-03-26 19:57:45 -06:00 committed by Kumar Gala
commit 24d71431e9
559 changed files with 2331 additions and 2328 deletions

View file

@ -35,10 +35,10 @@ static u32_t wdt_sam0_timeout_to_wdt_period(u32_t timeout_ms)
u32_t cycles;
/* Calculate number of clock cycles @ 1.024 kHz input clock */
cycles = (timeout_ms * 1024) / 1000;
cycles = (timeout_ms * 1024U) / 1000;
/* Minimum wdt period is 8 clock cycles (register value 0) */
if (cycles <= 8)
if (cycles <= 8U)
return 0;
/* Round up to next pow2 and calculate the register value */
@ -141,9 +141,9 @@ static int wdt_sam0_install_timeout(struct device *dev,
if (cfg->callback) {
if (per == WDT_CONFIG_PER_8_Val) {
/* Ensure we have time for the early warning */
per += 1;
per += 1U;
}
WDT_REGS->EWCTRL.bit.EWOFFSET = per - 1;
WDT_REGS->EWCTRL.bit.EWOFFSET = per - 1U;
}
window = WDT_CONFIG_PER_8_Val;
WDT_REGS->CTRL.bit.WEN = 0;