From d55f1d91ca0440d35d5908589dce7ea353cd57d1 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Mon, 7 Sep 2020 08:32:10 +0200 Subject: [PATCH] Alex's #2 review Signed-off-by: Miguel Ojeda --- drivers/char/rust_example/Cargo.toml | 1 + rust/kernel/Cargo.toml | 1 + rust/kernel/src/lib.rs | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/char/rust_example/Cargo.toml b/drivers/char/rust_example/Cargo.toml index c4adcdf3458a42..500476526018d8 100644 --- a/drivers/char/rust_example/Cargo.toml +++ b/drivers/char/rust_example/Cargo.toml @@ -6,6 +6,7 @@ name = "rust_example" version = "0.1.0" edition = "2018" +publish = false [lib] crate-type = ["staticlib"] diff --git a/rust/kernel/Cargo.toml b/rust/kernel/Cargo.toml index 24ccb09124103e..d7f6b5aa375dee 100644 --- a/rust/kernel/Cargo.toml +++ b/rust/kernel/Cargo.toml @@ -5,6 +5,7 @@ name = "kernel" version = "0.1.0" authors = ["Rust for Linux Contributors"] edition = "2018" +publish = false [dependencies] bitflags = "1" diff --git a/rust/kernel/src/lib.rs b/rust/kernel/src/lib.rs index 1469c77247bceb..1022e8b00d25d1 100644 --- a/rust/kernel/src/lib.rs +++ b/rust/kernel/src/lib.rs @@ -53,13 +53,16 @@ macro_rules! kernel_module { // Built-in modules are initialized through an initcall pointer // - // TODO: find a proper way to emulate the C macro, including - // dealing with `HAVE_ARCH_PREL32_RELOCATIONS` + // TODO: find a proper way to emulate the C macro (`module_init`), + // including dealing with `HAVE_ARCH_PREL32_RELOCATIONS` #[cfg(not(module))] #[link_section = ".initcall6.init"] #[used] pub static __initcall: extern "C" fn() -> $crate::c_types::c_int = init_module; + // TODO: pass the kernel module name here to generate a unique, + // helpful symbol name (the name would also useful for the `modinfo` + // issue below). #[no_mangle] pub extern "C" fn init_module() -> $crate::c_types::c_int { match <$module as $crate::KernelModule>::init() {