mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-10-01 05:25:46 +00:00
HV: include: integral type cleanup
This patch cleans up the integral type violations to MISRA C rules, mostly related to signed constants that should be unsigned but also spelling out two integer narrowing and dropping some macros negating unsigned integers. v1 -> v2: * Drop INT_ROUNDUPx macros since they are never used. Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -17,18 +17,6 @@
|
||||
|
||||
#define offsetof(st, m) __builtin_offsetof(st, m)
|
||||
|
||||
/** Round an integer (x) up to a multiple of y */
|
||||
#define INT_ROUNDUP(x, y) (((x)+((y)-1))&-(y))
|
||||
|
||||
/** Round an integer up to a multiple of 4 */
|
||||
#define INT_ROUNDUP4(x) INT_ROUNDUP(x, 4)
|
||||
|
||||
/** Round an integer up to a multiple of 8 */
|
||||
#define INT_ROUNDUP8(x) INT_ROUNDUP(x, 8)
|
||||
|
||||
/** Round an integer up to a multiple of 8 */
|
||||
#define INT_ROUNDUP16(x) INT_ROUNDUP(x, 16)
|
||||
|
||||
/** Roundup (x/y) to ( x/y + (x%y) ? 1 : 0) **/
|
||||
#define INT_DIV_ROUNDUP(x, y) (((x)+(y)-1)/(y))
|
||||
|
||||
|
Reference in New Issue
Block a user