From 657c1850abc49c81435db03c845a4b8b77dcf288 Mon Sep 17 00:00:00 2001 From: Sonny Rao Date: Tue, 6 Mar 2018 16:25:27 -0800 Subject: [PATCH] kvm: silence a warning on non-x86 builds We don't use this particular constant on non-x86 builds, so let's leave it out if when it's not needed. BUG=chromium:797868 TEST=build_test passes TEST=crosvm runs on caroline Change-Id: Ic752f9ae33d577d78c7df282e9803936aa181504 Reviewed-on: https://chromium-review.googlesource.com/952166 Commit-Ready: Sonny Rao Tested-by: Sonny Rao Reviewed-by: Dylan Reid --- kvm/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kvm/src/lib.rs b/kvm/src/lib.rs index 970452f737..486e6c6d3b 100644 --- a/kvm/src/lib.rs +++ b/kvm/src/lib.rs @@ -31,8 +31,6 @@ use sys_util::{ioctl, ioctl_with_val, ioctl_with_ref, ioctl_with_mut_ref, ioctl_ pub use cap::*; -const MAX_KVM_CPUID_ENTRIES: usize = 256; - fn errno_result() -> Result { Err(Error::last()) } @@ -135,6 +133,7 @@ impl Kvm { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] fn get_cpuid(&self, kind: u64) -> Result { + const MAX_KVM_CPUID_ENTRIES: usize = 256; let mut cpuid = CpuId::new(MAX_KVM_CPUID_ENTRIES); let ret = unsafe {