kata-ctl: Resolve non-minimal-cfg warning

- In rust 1.72, clippy warned clippy::non-minimal-cfg
as the cfg has only one condition, so doesn't
need to be wrapped in the any combinator.

Fixes: #7902
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman 2023-09-11 19:59:59 +01:00
parent 3eaf68d954
commit c8419fc3bb
2 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@
// Contains checks that are not architecture-specific // Contains checks that are not architecture-specific
#[cfg(any(target_arch = "x86_64"))] #[cfg(target_arch = "x86_64")]
use crate::types::KernelModule; use crate::types::KernelModule;
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};
@ -17,7 +17,7 @@ use reqwest::header::{CONTENT_TYPE, USER_AGENT};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use slog::{info, o}; use slog::{info, o};
#[cfg(any(target_arch = "x86_64"))] #[cfg(target_arch = "x86_64")]
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
#[derive(Debug, Deserialize, Serialize, PartialEq)] #[derive(Debug, Deserialize, Serialize, PartialEq)]
@ -84,7 +84,7 @@ pub fn check_cpu_flags(
Ok(missing_flags) Ok(missing_flags)
} }
#[cfg(any(target_arch = "x86_64"))] #[cfg(target_arch = "x86_64")]
pub fn check_cpu_attribs( pub fn check_cpu_attribs(
cpu_info: &str, cpu_info: &str,
required_attribs: &'static [&'static str], required_attribs: &'static [&'static str],
@ -236,7 +236,7 @@ pub fn check_official_releases() -> Result<()> {
Ok(()) Ok(())
} }
#[cfg(any(target_arch = "x86_64"))] #[cfg(target_arch = "x86_64")]
pub fn check_kernel_module_loaded(kernel_module: &KernelModule) -> Result<(), String> { pub fn check_kernel_module_loaded(kernel_module: &KernelModule) -> Result<(), String> {
const MODPROBE_PARAMETERS_DRY_RUN: &str = "--dry-run"; const MODPROBE_PARAMETERS_DRY_RUN: &str = "--dry-run";
const MODPROBE_PARAMETERS_FIRST_TIME: &str = "--first-time"; const MODPROBE_PARAMETERS_FIRST_TIME: &str = "--first-time";
@ -305,7 +305,7 @@ pub fn check_kernel_module_loaded(kernel_module: &KernelModule) -> Result<(), St
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
#[cfg(any(target_arch = "x86_64"))] #[cfg(target_arch = "x86_64")]
use crate::types::{KernelModule, KernelParam, KernelParamType}; use crate::types::{KernelModule, KernelParam, KernelParamType};
use kata_sys_util::cpu::{get_cpu_flags, get_single_cpu_info}; use kata_sys_util::cpu::{get_cpu_flags, get_single_cpu_info};
use semver::Version; use semver::Version;
@ -509,7 +509,7 @@ mod tests {
assert!(!v.patch.to_string().is_empty()); assert!(!v.patch.to_string().is_empty());
} }
#[cfg(any(target_arch = "x86_64"))] #[cfg(target_arch = "x86_64")]
#[test] #[test]
fn check_module_loaded() { fn check_module_loaded() {
#[allow(dead_code)] #[allow(dead_code)]

View File

@ -239,7 +239,7 @@ mod tests {
assert!(res.is_ok()); assert!(res.is_ok());
} }
#[cfg(any(target_arch = "x86_64"))] #[cfg(target_arch = "x86_64")]
#[test] #[test]
fn get_generic_cpu_details_system() { fn get_generic_cpu_details_system() {
let res = get_generic_cpu_details(crate::check::PROC_CPUINFO); let res = get_generic_cpu_details(crate::check::PROC_CPUINFO);