mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-03 20:59:53 +00:00
MISRA-C requires that shift operation cannot exceed the word length. What this patch does: - Fix the bug in 'vuart_init' The register 'dll' and 'dlh' should be uint8_t rather than char. 'dll' is the lower 8-bit of divisor. 'dlh' is the higher 8-bit of divisor. So, the shift value should be 8U rather than 16U. - Fix other data type issues regarding to the registers in 'struct vuart' The registers should be unsigned variables. v1 -> v2: * Use a local variable 'uint8_t value_u8 = (uint8_t)value' to avoid mutiple times type conversion * Use '(uint8_t)divisor' rather than '(uint8_t)(divisor & 0xFFU)' to get the lower 8 bit of 'divisor' Direct type conversion is safe and simple per Xiangyang's suggestion. Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com> |
||
---|---|---|
.. | ||
console.c | ||
dump.c | ||
logmsg.c | ||
printf.c | ||
sbuf.c | ||
shell_priv.h | ||
shell.c | ||
uart16550.c | ||
uart16550.h | ||
vuart.c |