mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 23:57:10 +00:00
hv: add brackets to make operator expression more readable
v1-v2: Bypass this case: When binary arithmetic operators of different precedence (e.g. '+' and '*') are mixed in an expression, parentheses are added to the sub-expressions using the operator with a higher precedence. v1: The operator precedence rules are complicated and it is easy to make a mistake. So add brackets to make operator expression more readable. Tracked-On: #861 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -652,9 +652,9 @@ static int32_t write_protect_page(struct acrn_vm *vm,const struct wp_data *wp)
|
||||
vm->vm_id, wp->gpa, hpa);
|
||||
|
||||
base_paddr = get_hv_image_base();
|
||||
if (((hpa <= base_paddr) && (hpa + CPU_PAGE_SIZE > base_paddr)) ||
|
||||
if (((hpa <= base_paddr) && ((hpa + CPU_PAGE_SIZE) > base_paddr)) ||
|
||||
((hpa >= base_paddr) &&
|
||||
(hpa < base_paddr + CONFIG_HV_RAM_SIZE))) {
|
||||
(hpa < (base_paddr + CONFIG_HV_RAM_SIZE)))) {
|
||||
pr_err("%s: overlap the HV memory region.", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user