mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: reevaluate #[allow] attributes
Remove stale #[allow]s whose lints no longer fire, convert the unconditionally-firing ones to #[expect], and keep the conditional ones as #[allow] (e.g. large_enum_variant only fires when both kvm and mshv are enabled; a nonminimal_bool only on x86). The many unreachable_patterns allows are feature-gated and left as #[allow]. Part of #8326. Signed-off-by: Tushar Khatri <hello@tusharkhatri.in>
This commit is contained in:
committed by
Rob Bradford
parent
d6e59a0be7
commit
859bce5cae
@@ -233,7 +233,7 @@ pub struct MshvHypervisor {
|
||||
|
||||
impl MshvHypervisor {
|
||||
/// Create a hypervisor based on Mshv
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
#[expect(clippy::new_ret_no_self)]
|
||||
pub fn new() -> hypervisor::Result<Arc<dyn hypervisor::Hypervisor>> {
|
||||
let mshv_obj =
|
||||
Mshv::new().map_err(|e| hypervisor::HypervisorError::HypervisorCreate(e.into()))?;
|
||||
@@ -586,7 +586,7 @@ impl cpu::Vcpu for MshvVcpu {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(non_upper_case_globals)]
|
||||
#[expect(non_upper_case_globals)]
|
||||
fn run(&mut self) -> std::result::Result<cpu::VmExit, cpu::HypervisorCpuError> {
|
||||
match self.fd.run() {
|
||||
Ok(x) => match x.header.message_type {
|
||||
|
||||
@@ -23,7 +23,7 @@ pub struct MshvEmulatorContext<'a> {
|
||||
|
||||
impl MshvEmulatorContext<'_> {
|
||||
// Do the actual gva -> gpa translation
|
||||
#[allow(non_upper_case_globals)]
|
||||
#[expect(non_upper_case_globals)]
|
||||
fn translate(&self, gva: u64, flags: u32) -> Result<u64, PlatformError> {
|
||||
if let Some((cached_gva, cached_gpa)) = self.mapping
|
||||
&& cached_gva == gva
|
||||
|
||||
Reference in New Issue
Block a user