Skip to content

Commit f0e52fe

Browse files
authored
fix nits on non-x86 (#1150)
Fix a couple of warnings when running `cargo check` on non-x86 machines, e.g. an ARM64 Mac.
1 parent 378f5d7 commit f0e52fe

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

crates/cpuid-utils/src/host.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn query(leaf: CpuidIdent) -> CpuidValues {
8787
}
8888

8989
#[cfg(not(target_arch = "x86_64"))]
90-
pub fn query(leaf: CpuidIdent) -> CpuidValues {
90+
pub fn query(_leaf: CpuidIdent) -> CpuidValues {
9191
panic!("host CPUID queries only work on x86-64 hosts")
9292
}
9393

lib/propolis/src/vcpu.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use migrate::VcpuReadWrite;
2626
use thiserror::Error;
2727

2828
use bhyve_api::ApiVersion;
29-
use propolis_types::{CpuidIdent, CpuidValues, CpuidVendor};
29+
use propolis_types::{CpuidIdent, CpuidVendor};
3030

3131
#[usdt::provider(provider = "propolis")]
3232
mod probes {
@@ -77,7 +77,9 @@ impl Vcpu {
7777
#[cfg(target_arch = "x86_64")]
7878
fn query_hardware_vendor() -> CpuidVendor {
7979
let res = unsafe { core::arch::x86_64::__cpuid(0) };
80-
CpuidValues::from(res).try_into().expect("CPU vendor is recognized")
80+
propolis_types::CpuidValues::from(res)
81+
.try_into()
82+
.expect("CPU vendor is recognized")
8183
}
8284

8385
#[cfg(not(target_arch = "x86_64"))]

0 commit comments

Comments
 (0)