Compare commits

..

No commits in common. "358c1104dc9fb0cc23cd8d11bb6b498146b55152" and "427f696b5d6f0d2d53af0820161c0fd89c5c276c" have entirely different histories.

3 changed files with 7 additions and 16 deletions

1
.gitignore vendored
View File

@ -8,4 +8,3 @@
*.rmeta
Module.symvers
modules.order
rust-project.json

View File

@ -31,14 +31,6 @@ make[1]: Leaving directory '.../linux-with-rust-support'
[ 1.085944] rust_out_of_tree: Rust out-of-tree sample (exit)
```
For details about the Rust support, see https://rust-for-linux.com.
For details about the Rust support, see https://github.com/Rust-for-Linux/linux.
For details about out-of-tree modules, see https://docs.kernel.org/kbuild/modules.html.
## rust-analyzer
Rust for Linux (with https://lore.kernel.org/rust-for-linux/20230121052507.885734-1-varmavinaym@gmail.com/ applied) supports building a `rust-project.json` configuration for [`rust-analyzer`](https://rust-analyzer.github.io/), including for out-of-tree modules:
```sh
make -C .../linux-with-rust-support M=$PWD rust-analyzer
```
For details about out-of-tree modules, see https://www.kernel.org/doc/html/latest/kbuild/modules.html.

View File

@ -6,10 +6,10 @@ use kernel::prelude::*;
module! {
type: RustOutOfTree,
name: b"rust_out_of_tree",
author: b"Rust for Linux Contributors",
description: b"Rust out-of-tree sample",
license: b"GPL",
name: "rust_out_of_tree",
author: "Rust for Linux Contributors",
description: "Rust out-of-tree sample",
license: "GPL",
}
struct RustOutOfTree {
@ -17,7 +17,7 @@ struct RustOutOfTree {
}
impl kernel::Module for RustOutOfTree {
fn init(_module: &'static ThisModule) -> Result<Self> {
fn init(_name: &'static CStr, _module: &'static ThisModule) -> Result<Self> {
pr_info!("Rust out-of-tree sample (init)\n");
let mut numbers = Vec::new();