diff options
| author | Miguel Ojeda <[email protected]> | 2024-11-23 22:28:47 +0000 |
|---|---|---|
| committer | Miguel Ojeda <[email protected]> | 2025-01-09 23:19:05 +0000 |
| commit | 15f2f9313a394f97fb9443271721e9ff1c8d4be4 (patch) | |
| tree | 0ce3d955f08d166605464c286cb2e8be05692ebc /rust/macros/lib.rs | |
| parent | rust: kbuild: run Clippy for `rusttest` code (diff) | |
| download | kernel-15f2f9313a394f97fb9443271721e9ff1c8d4be4.tar.gz kernel-15f2f9313a394f97fb9443271721e9ff1c8d4be4.zip | |
rust: use the `build_error!` macro, not the hidden function
Code and some examples were using the function, rather than the macro. The
macro is what is documented.
Thus move users to the macro.
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Applied the change to the new miscdevice cases. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/macros/lib.rs')
| -rw-r--r-- | rust/macros/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs index 4ab94e44adfe..1a30c8075ebd 100644 --- a/rust/macros/lib.rs +++ b/rust/macros/lib.rs @@ -123,12 +123,12 @@ pub fn module(ts: TokenStream) -> TokenStream { /// used on the Rust side, it should not be possible to call the default /// implementation. This is done to ensure that we call the vtable methods /// through the C vtable, and not through the Rust vtable. Therefore, the -/// default implementation should call `kernel::build_error`, which prevents +/// default implementation should call `kernel::build_error!`, which prevents /// calls to this function at compile time: /// /// ```compile_fail /// # // Intentionally missing `use`s to simplify `rusttest`. -/// kernel::build_error(VTABLE_DEFAULT_ERROR) +/// kernel::build_error!(VTABLE_DEFAULT_ERROR) /// ``` /// /// Note that you might need to import [`kernel::error::VTABLE_DEFAULT_ERROR`]. @@ -145,11 +145,11 @@ pub fn module(ts: TokenStream) -> TokenStream { /// #[vtable] /// pub trait Operations: Send + Sync + Sized { /// fn foo(&self) -> Result<()> { -/// kernel::build_error(VTABLE_DEFAULT_ERROR) +/// kernel::build_error!(VTABLE_DEFAULT_ERROR) /// } /// /// fn bar(&self) -> Result<()> { -/// kernel::build_error(VTABLE_DEFAULT_ERROR) +/// kernel::build_error!(VTABLE_DEFAULT_ERROR) /// } /// } /// |
