mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +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:
@@ -828,7 +828,7 @@ int32_t hcall_setup_hv_npk_log(struct vm *vm, uint64_t param)
|
||||
{
|
||||
struct hv_npk_log_param npk_param;
|
||||
|
||||
memset((void *)&npk_param, 0, sizeof(npk_param));
|
||||
memset((void *)&npk_param, 0U, sizeof(npk_param));
|
||||
|
||||
if (copy_from_gpa(vm, &npk_param, param, sizeof(npk_param)) != 0) {
|
||||
pr_err("%s: Unable copy param from vm\n", __func__);
|
||||
|
@@ -96,7 +96,7 @@ int load_guest(struct vm *vm, struct vcpu *vcpu)
|
||||
lowmem_gpa_top = *(uint64_t *)hva;
|
||||
|
||||
/* hardcode vcpu entry addr(kernel entry) & rsi (zeropage)*/
|
||||
for (i = 0; i < NUM_GPRS; i++) {
|
||||
for (i = 0U; i < NUM_GPRS; i++) {
|
||||
vcpu_set_gpreg(vcpu, i, 0UL);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
|
||||
/* Documentation states: ebx=0, edi=0, ebp=0, esi=ptr to
|
||||
* zeropage
|
||||
*/
|
||||
for (i = 0; i < NUM_GPRS; i++) {
|
||||
for (i = 0U; i < NUM_GPRS; i++) {
|
||||
vcpu_set_gpreg(vcpu, i, 0UL);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user