Skip to content

Commit

Permalink
x86/hvm: address a violation of MISRA C:2012 Rule 11.8
Browse files Browse the repository at this point in the history
The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
headline states:
"A conversion shall not remove any const, volatile or _Atomic qualification
from the type pointed to by a pointer".

Remove unnecessary cast.
from is a const-qualified pointer to void and the function hvm_copy_to_guest_linear
requires a const void* type argument, therefore the cast to void* is not necessary.

No functional change.

Signed-off-by: Maria Celeste Cesario  <[email protected]>
Signed-off-by: Simone Ballarin  <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
  • Loading branch information
Maria Celeste Cesario authored and jbeulich committed Dec 18, 2023
1 parent abdee7b commit 0cc7437
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xen/arch/x86/hvm/hvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3462,7 +3462,7 @@ unsigned int copy_to_user_hvm(void *to, const void *from, unsigned int len)
return 0;
}

rc = hvm_copy_to_guest_linear((unsigned long)to, (void *)from, len, 0, NULL);
rc = hvm_copy_to_guest_linear((unsigned long)to, from, len, 0, NULL);
return rc ? len : 0; /* fake a copy_to_user() return code */
}

Expand Down

0 comments on commit 0cc7437

Please sign in to comment.