From 016690da9d85bfc45ba5935e9e182efcbf4373e3 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 17 Oct 2024 18:31:30 -0300 Subject: [PATCH] rust: samples: fix init argument After commit c96b54717a28: rust: Add `name` argument to Module::init() init needs a name argument. Since both rust samples were made before that, they fail to compile. Signed-off-by: Bruno Oliveira --- samples/rust/rust_minimal.rs | 2 +- samples/rust/rust_print.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/rust/rust_minimal.rs b/samples/rust/rust_minimal.rs index 2a9eaab62d1ca7..3b918ff5eebbeb 100644 --- a/samples/rust/rust_minimal.rs +++ b/samples/rust/rust_minimal.rs @@ -17,7 +17,7 @@ struct RustMinimal { } impl kernel::Module for RustMinimal { - fn init(_module: &'static ThisModule) -> Result { + fn init(_name: &'static CStr, _module: &'static ThisModule) -> Result { pr_info!("Rust minimal sample (init)\n"); pr_info!("Am I built-in? {}\n", !cfg!(MODULE)); diff --git a/samples/rust/rust_print.rs b/samples/rust/rust_print.rs index 6eabb0d79ea3a7..722275a735f1d9 100644 --- a/samples/rust/rust_print.rs +++ b/samples/rust/rust_print.rs @@ -40,7 +40,7 @@ fn arc_print() -> Result { } impl kernel::Module for RustPrint { - fn init(_module: &'static ThisModule) -> Result { + fn init(_name: &'static CStr, _module: &'static ThisModule) -> Result { pr_info!("Rust printing macros sample (init)\n"); pr_emerg!("Emergency message (level 0) without args\n");