Skip to content

Commit

Permalink
Fix warnings in aarch64
Browse files Browse the repository at this point in the history
Signed-off-by: StemCll [email protected]
  • Loading branch information
StemCll committed Oct 31, 2022
1 parent 8aa0094 commit c790a5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/arch/src/aarch64/fdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ fn create_cpu_nodes(fdt: &mut FdtWriter, vcpu_mpidr: &[u64]) -> Result<()> {
fdt.property_u32(cache.type_.of_cache_size(), size as u32)?;
}
if let Some(line_size) = cache.line_size {
fdt.property_u32(cache.type_.of_cache_line_size(), line_size as u32)?;
fdt.property_u32(cache.type_.of_cache_line_size(), u32::from(line_size))?;
}
if let Some(number_of_sets) = cache.number_of_sets {
fdt.property_u32(cache.type_.of_cache_sets(), number_of_sets as u32)?;
fdt.property_u32(cache.type_.of_cache_sets(), u32::from(number_of_sets))?;
}
}

Expand Down Expand Up @@ -188,15 +188,15 @@ fn create_cpu_nodes(fdt: &mut FdtWriter, vcpu_mpidr: &[u64]) -> Result<()> {
))?);
fdt.property_u32("phandle", cache_phandle)?;
fdt.property_string("compatible", "cache")?;
fdt.property_u32("cache-level", cache.level as u32)?;
fdt.property_u32("cache-level", u32::from(cache.level))?;
if let Some(size) = cache.size_ {
fdt.property_u32(cache.type_.of_cache_size(), size as u32)?;
}
if let Some(line_size) = cache.line_size {
fdt.property_u32(cache.type_.of_cache_line_size(), line_size as u32)?;
fdt.property_u32(cache.type_.of_cache_line_size(), u32::from(line_size))?;
}
if let Some(number_of_sets) = cache.number_of_sets {
fdt.property_u32(cache.type_.of_cache_sets(), number_of_sets as u32)?;
fdt.property_u32(cache.type_.of_cache_sets(), u32::from(number_of_sets))?;
}
if let Some(cache_type) = cache.type_.of_cache_type() {
fdt.property_null(cache_type)?;
Expand Down
4 changes: 2 additions & 2 deletions src/arch/src/aarch64/regs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pub fn setup_boot_regs(
///
/// * `regid` - The index of the register we are checking.
pub fn is_system_register(regid: u64) -> bool {
if (regid & KVM_REG_ARM_COPROC_MASK as u64) == KVM_REG_ARM_CORE as u64 {
if (regid & u64::from(KVM_REG_ARM_COPROC_MASK)) == u64::from(KVM_REG_ARM_CORE) {
return false;
}

Expand Down Expand Up @@ -505,7 +505,7 @@ mod tests {
assert!(!is_system_register(regid));
let regid = KVM_REG_ARM64 as u64
| KVM_REG_SIZE_U64 as u64
| kvm_bindings::KVM_REG_ARM64_SYSREG as u64;
| u64::from(kvm_bindings::KVM_REG_ARM64_SYSREG);
assert!(is_system_register(regid));
}

Expand Down

0 comments on commit c790a5b

Please sign in to comment.