mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 20:54:10 +08:00
Minor cocci warning fixes:
1) Bool return warning fix 2) Unnedded semicolon warning fix -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEZdn75s5e6LHDQ+f/rUjsVaLHLAcFAmF/3MYACgkQrUjsVaLH LAfDug/8ClJKFEdpjMr+wMjKgCTwMNGSy8Zk4eeOij9fGkCUdQ03Y7WWQ0bsR8K1 FNzmczptj+mwrLqcxuA/G3Dl3BBJal3+M34MVItT3IUU4f6MRM86cSX+86sULxPj 0l0P7Q9bxXzr3o0tp23MAA8HfwkM1BsTYoFREDPV3ozRaOzh26AtO/yLp0Gmu0AU K/SuB13nYYHbcyHJjEc8a2ExDo1Q7YpFdIe39fdpMG8YPeYZX8fkc3ghdn1MqwCV X/CmLWbP8UBQeAzL5uSNEUzxMDSomq+LVjU31H0S4yrTpB0/d3fuJY4s7vcjK1dd rmJpaP6W9uhYQCPSaVol7Xf+2SFCgi0NCFnGTA3/MPOvodUq8r+47zHGa49cuT+/ PqhCayZvkzXfMbKS1Sl8HPDD9095BRPEc/ZMRalpA5gz9euk2vO0h5ukQHvy6sDH O2zr6PP5DMk/UWQLHbRe9SxZXdV166+6jP/4h9P3t+EfQsMzqUMXlRIZIbz63PsL b0aMKQoQnvL9DcUGETZDdtjNSLbVTIrxgYzfZ6lNTOsbtvOWTxLceapx/DHNFAtW H4vADifgKhDMy80lcLGGHZrMNHrbW9p4sXe/JmwokgPi1LflhRMTM1HgLBwNESdI +Pp0x4cry4zTVAbi3SkGwRfAfA1PBr8QcIblgph8PuJIbqeNjBo= =lEoS -----END PGP SIGNATURE----- Merge tag 'kvm-riscv-5.16-2' of https://github.com/kvm-riscv/linux into HEAD Minor cocci warning fixes: 1) Bool return warning fix 2) Unnedded semicolon warning fix
This commit is contained in:
commit
52cf891d8d
@ -565,12 +565,12 @@ out:
|
||||
bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)
|
||||
{
|
||||
if (!kvm->arch.pgd)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
stage2_unmap_range(kvm, range->start << PAGE_SHIFT,
|
||||
(range->end - range->start) << PAGE_SHIFT,
|
||||
range->may_block);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool kvm_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
|
||||
@ -579,7 +579,7 @@ bool kvm_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
|
||||
kvm_pfn_t pfn = pte_pfn(range->pte);
|
||||
|
||||
if (!kvm->arch.pgd)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
WARN_ON(range->end - range->start != 1);
|
||||
|
||||
@ -587,10 +587,10 @@ bool kvm_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
|
||||
__pfn_to_phys(pfn), PAGE_SIZE, true, true);
|
||||
if (ret) {
|
||||
kvm_debug("Failed to map stage2 page (error %d)\n", ret);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool kvm_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
|
||||
@ -600,13 +600,13 @@ bool kvm_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
|
||||
u64 size = (range->end - range->start) << PAGE_SHIFT;
|
||||
|
||||
if (!kvm->arch.pgd)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
WARN_ON(size != PAGE_SIZE && size != PMD_SIZE && size != PGDIR_SIZE);
|
||||
|
||||
if (!stage2_get_leaf_entry(kvm, range->start << PAGE_SHIFT,
|
||||
&ptep, &ptep_level))
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
return ptep_test_and_clear_young(NULL, 0, ptep);
|
||||
}
|
||||
@ -618,13 +618,13 @@ bool kvm_test_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
|
||||
u64 size = (range->end - range->start) << PAGE_SHIFT;
|
||||
|
||||
if (!kvm->arch.pgd)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
WARN_ON(size != PAGE_SIZE && size != PMD_SIZE && size != PGDIR_SIZE);
|
||||
|
||||
if (!stage2_get_leaf_entry(kvm, range->start << PAGE_SHIFT,
|
||||
&ptep, &ptep_level))
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
return pte_young(*ptep);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ static int kvm_riscv_vcpu_get_reg_config(struct kvm_vcpu *vcpu,
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
};
|
||||
}
|
||||
|
||||
if (copy_to_user(uaddr, ®_val, KVM_REG_SIZE(reg->id)))
|
||||
return -EFAULT;
|
||||
@ -201,7 +201,7 @@ static int kvm_riscv_vcpu_set_reg_config(struct kvm_vcpu *vcpu,
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
};
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ static int emulate_store(struct kvm_vcpu *vcpu, struct kvm_run *run,
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
};
|
||||
}
|
||||
|
||||
/* Update MMIO details in kvm_run struct */
|
||||
run->mmio.is_write = true;
|
||||
@ -642,7 +642,7 @@ int kvm_riscv_vcpu_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run)
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
};
|
||||
}
|
||||
|
||||
done:
|
||||
/* Move to next instruction */
|
||||
@ -684,7 +684,7 @@ int kvm_riscv_vcpu_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
/* Print details in-case of error */
|
||||
if (ret < 0) {
|
||||
|
@ -166,7 +166,7 @@ int kvm_riscv_vcpu_sbi_ecall(struct kvm_vcpu *vcpu, struct kvm_run *run)
|
||||
/* Return error for unsupported SBI calls */
|
||||
cp->a0 = SBI_ERR_NOT_SUPPORTED;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
if (next_sepc)
|
||||
cp->sepc += 4;
|
||||
|
@ -120,7 +120,7 @@ int kvm_riscv_vcpu_get_reg_timer(struct kvm_vcpu *vcpu,
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
};
|
||||
}
|
||||
|
||||
if (copy_to_user(uaddr, ®_val, KVM_REG_SIZE(reg->id)))
|
||||
return -EFAULT;
|
||||
@ -167,7 +167,7 @@ int kvm_riscv_vcpu_set_reg_timer(struct kvm_vcpu *vcpu,
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user