From f7f1f1e6bef74e7dd2bd4a7d49059d68cfe77977 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 26 Dec 2023 20:30:44 +0800 Subject: [PATCH] Fix clippy errors Fix #641 Signed-off-by: Wei Liu --- td-payload/src/bin/example/main.rs | 2 +- td-payload/src/bin/example/stack.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/td-payload/src/bin/example/main.rs b/td-payload/src/bin/example/main.rs index 2962bbd9..50c19581 100644 --- a/td-payload/src/bin/example/main.rs +++ b/td-payload/src/bin/example/main.rs @@ -49,7 +49,7 @@ pub extern "C" fn main() -> ! { #[cfg(feature = "benches")] { - stack::bench_stack(memory_layout); + stack::bench_stack(); } #[cfg(feature = "tdx")] diff --git a/td-payload/src/bin/example/stack.rs b/td-payload/src/bin/example/stack.rs index e673172d..c2d0dab5 100644 --- a/td-payload/src/bin/example/stack.rs +++ b/td-payload/src/bin/example/stack.rs @@ -13,6 +13,7 @@ // limitations under the License. // This function will cause page fault by memory protection. +use core::arch::asm; use td_benchmark::StackProfiling; use td_payload::{mm::layout::DEFAULT_STACK_SIZE, println}; @@ -29,7 +30,7 @@ fn test_stack() { let b = vec![1u8, 2, 3, 4]; } -pub fn bench_stack(memory_layout: RuntimeMemoryLayout) { +pub fn bench_stack() { StackProfiling::init(0x5a5a_5a5a_5a5a_5a5a, 0x20_0000); test_stack(); let stack_usage = StackProfiling::stack_usage().unwrap();