summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2020-09-07 08:32:10 +0200
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2020-09-07 08:40:14 +0200
commitd55f1d91ca0440d35d5908589dce7ea353cd57d1 (patch)
treed106cdc73faae3de2376ce26525c3f6a9f971b59
parent351ab09b7d2b338d34125bfaf684348303cb6909 (diff)
Alex's #2 review
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
-rw-r--r--drivers/char/rust_example/Cargo.toml1
-rw-r--r--rust/kernel/Cargo.toml1
-rw-r--r--rust/kernel/src/lib.rs7
3 files changed, 7 insertions, 2 deletions
diff --git a/drivers/char/rust_example/Cargo.toml b/drivers/char/rust_example/Cargo.toml
index c4adcdf3458a..500476526018 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 24ccb0912410..d7f6b5aa375d 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 1469c77247bc..1022e8b00d25 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() {