From bc09a2d8aa130bc42b5c0348a37f817fd1637ab5 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Mon, 21 Mar 2022 12:28:13 -0700 Subject: [PATCH] devices: acpi: use slice instead of vectors to pass around direct GPEs We make a copy of the data when creating instance of ACPIPMResource, so let's use slice to pass the data around. BUG=None TEST=./tools/presubmit Change-Id: Idf9627c4ef6aee86fa9de4d1c24ec45aa684432e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3537263 Reviewed-by: Daniel Verkamp Tested-by: kokoro Commit-Queue: Dmitry Torokhov --- devices/src/acpi.rs | 2 +- x86_64/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/devices/src/acpi.rs b/devices/src/acpi.rs index 805171c103..fa075cc9ff 100644 --- a/devices/src/acpi.rs +++ b/devices/src/acpi.rs @@ -72,7 +72,7 @@ impl ACPIPMResource { sci_evt: Event, sci_evt_resample: Event, #[cfg(feature = "direct")] sci_direct_evt: Option<(Event, Event)>, - #[cfg(feature = "direct")] direct_gpe: Vec, + #[cfg(feature = "direct")] direct_gpe: &[u32], suspend_evt: Event, exit_evt: Event, ) -> ACPIPMResource { diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs index 63068c1dd7..f41d853467 100644 --- a/x86_64/src/lib.rs +++ b/x86_64/src/lib.rs @@ -550,7 +550,7 @@ impl arch::LinuxArch for X8664arch { exit_evt.try_clone().map_err(Error::CloneEvent)?, components.acpi_sdts, #[cfg(feature = "direct")] - components.direct_gpe, + &components.direct_gpe, irq_chip.as_irq_chip_mut(), sci_irq, battery, @@ -1283,7 +1283,7 @@ impl X8664arch { suspend_evt: Event, exit_evt: Event, sdts: Vec, - #[cfg(feature = "direct")] direct_gpe: Vec, + #[cfg(feature = "direct")] direct_gpe: &[u32], irq_chip: &mut dyn IrqChip, sci_irq: u32, battery: (&Option, Option), @@ -1335,7 +1335,7 @@ impl X8664arch { sci_devirq.sci_irq_prepare().map_err(Error::CreateGpe)?; - for gpe in &direct_gpe { + for gpe in direct_gpe { sci_devirq .gpe_enable_forwarding(*gpe) .map_err(Error::CreateGpe)?;