mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
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 <aliceryhl@google.com> Link: https://lore.kernel.org/r/20241123222849.350287-1-ojeda@kernel.org [ Applied the change to the new miscdevice cases. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
@@ -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)
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user