mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
hv:treewide:fix multiple MISRAC violations
MISRAC has requirements about literal value requires a U suffix and signed/unsigned conversion with cast. This patch is used to solve these violations. v1->v2 *Drop the cast of sz from uint32_t to int32_t, the signed/unsigned violation of nchars will be solved by other patch together with printf/sprintf/console/vuart/uart code. *Delete the unnecessary L suffix of shifting operand. Tracked-On: #861 Signed-off-by: Junjun Shan <junjun.shan@intel.com> Reviewed by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
@@ -265,7 +265,7 @@ void *alloc_paging_struct(void)
|
||||
ptr = alloc_page();
|
||||
|
||||
ASSERT(ptr != NULL, "page alloc failed!");
|
||||
(void)memset(ptr, 0, CPU_PAGE_SIZE);
|
||||
(void)memset(ptr, 0U, CPU_PAGE_SIZE);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ void *alloc_paging_struct(void)
|
||||
void free_paging_struct(void *ptr)
|
||||
{
|
||||
if (ptr != NULL) {
|
||||
(void)memset(ptr, 0, CPU_PAGE_SIZE);
|
||||
(void)memset(ptr, 0U, CPU_PAGE_SIZE);
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user